diff options
author | Bryan Newbold <bnewbold@archive.org> | 2021-06-01 02:20:13 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2021-06-02 00:38:51 -0700 |
commit | a8d75f256d92da3a05a4f8d080f3d518f4a2b12e (patch) | |
tree | a1d49985149a0f09e2d91e9c98d4e852d454273f /fatcat_scholar/work_pipeline.py | |
parent | 4a40c62f6616825342bb23d03b9c4b9eebfe809c (diff) | |
download | fatcat-scholar-a8d75f256d92da3a05a4f8d080f3d518f4a2b12e.tar.gz fatcat-scholar-a8d75f256d92da3a05a4f8d080f3d518f4a2b12e.zip |
lint fixes, and run fmt
Diffstat (limited to 'fatcat_scholar/work_pipeline.py')
-rw-r--r-- | fatcat_scholar/work_pipeline.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fatcat_scholar/work_pipeline.py b/fatcat_scholar/work_pipeline.py index b90b747..2b09821 100644 --- a/fatcat_scholar/work_pipeline.py +++ b/fatcat_scholar/work_pipeline.py @@ -218,9 +218,7 @@ class WorkPipeline: webcapture_ident=wc.ident, ) - def fetch_crossref( - self, re: ReleaseEntity - ) -> Optional[Dict[str, Any]]: + def fetch_crossref(self, re: ReleaseEntity) -> Optional[Dict[str, Any]]: """ Fetches (cached) crossref metadata JSON from sandcrawler-db via postgrest HTTP interface. @@ -234,16 +232,18 @@ class WorkPipeline: if not re.ext_ids.doi: # can't do lookup without a DOI return None - if re.extra and (not re.extra.get('crossref')) and (re.extra.get('datacite') or re.extra.get('jalc')): + if ( + re.extra + and (not re.extra.get("crossref")) + and (re.extra.get("datacite") or re.extra.get("jalc")) + ): # if this is definitely a Datacite or JALC DOI, can skip the Crossref cache lookup return None doi = re.ext_ids.doi.lower() crossref_meta = self.sandcrawler_db_client.get_crossref(doi) if not crossref_meta or not crossref_meta.get("record"): return None - return dict( - release_ident=re.ident, doi=doi, record=crossref_meta["record"], - ) + return dict(release_ident=re.ident, doi=doi, record=crossref_meta["record"],) def lookup_sim(self, release: ReleaseEntity) -> Optional[SimIssueRow]: """ |