feat(mapper): Set publication date based on resource type - #595
Open
sakshamarora1 wants to merge 1 commit into
Open
feat(mapper): Set publication date based on resource type#595sakshamarora1 wants to merge 1 commit into
sakshamarora1 wants to merge 1 commit into
Conversation
sakshamarora1
force-pushed
the
fix/dates_mapping
branch
from
September 4, 2026 08:00
7785752 to
3d8bf5c
Compare
kpsherva
reviewed
Sep 4, 2026
| publication_date = normalize(publication_date_str) | ||
|
|
||
| return publication_date | ||
| store_priority_date(self, "article", publication_date) |
Contributor
There was a problem hiding this comment.
I would prefer if this is done a bit cleaner, because this additional nested key is making things more complex.
let's map 260__c as publication_date (as is) and 269__c as preprint_date, then please check my comment in the mapper as next
Contributor
Author
There was a problem hiding this comment.
Yeah makes sense, I have updated the PR accordingly
sakshamarora1
force-pushed
the
fix/dates_mapping
branch
from
September 4, 2026 08:07
3d8bf5c to
1bee54b
Compare
kpsherva
reviewed
Sep 4, 2026
Comment on lines
+79
to
+82
| priority_dates = dojson_entry.pop("_publication_date_candidates", {}) | ||
| article_date = priority_dates.get("article") | ||
| preprint_date = priority_dates.get("preprint") | ||
| resource_type = (dojson_entry.get("resource_type") or {}).get("id") |
Contributor
There was a problem hiding this comment.
instead of nested _publication_date_candidates, could you use publication_date and preprint date here? it will be very similar in logic but you will not need the check in line 113
so basically
pub_date = dojson_entry["publication_date"]
if (restype != "article" and is_more_accurate(dojson_entry["preprint_date"])) or restype=="preprint":
pub_date = dojson_entry["preprint_date"]
sakshamarora1
force-pushed
the
fix/dates_mapping
branch
from
September 4, 2026 08:56
1bee54b to
83a3b9c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes: #581