Skip to content

Commit

Permalink
Filter Crossref type and fix release_date naming in oa web workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jdddog committed Jun 15, 2023
1 parent 88c0ea7 commit ba0e490
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,7 @@ SELECT

FROM `{{ project_id }}.{{ dataset_id }}.doi{{ snapshot_date.strftime('%Y%m%d') }}` as dois, UNNEST(dois.affiliations.{{ aggregation_field }}) as aggregrate
WHERE aggregrate.identifier IS NOT NULL
AND dois.crossref.type NOT IN ("dataset")
GROUP BY aggregrate.identifier, crossref.{{ group_by_time_field }}
)

Expand Down
6 changes: 3 additions & 3 deletions academic_observatory_workflows/workflows/oa_web_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ def build_datasets(self, release: OaWebRelease, **kwargs):
)
for version in versions
]
last_updated = zenodo_versions[0].snapshot_date.format("D MMMM YYYY")
last_updated = zenodo_versions[0].release_date.format("D MMMM YYYY")
country_stats = make_entity_stats(countries)
institution_stats = make_entity_stats(institutions)
stats = Stats(START_YEAR, END_YEAR, last_updated, zenodo_versions, country_stats, institution_stats)
Expand Down Expand Up @@ -960,11 +960,11 @@ def to_dict(self) -> Dict:

@dataclasses.dataclass
class ZenodoVersion:
snapshot_date: pendulum.DateTime
release_date: pendulum.DateTime
download_url: str

def to_dict(self) -> Dict:
return {"snapshot_date": self.snapshot_date.strftime("%Y-%m-%d"), "download_url": self.download_url}
return {"release_date": self.release_date.strftime("%Y-%m-%d"), "download_url": self.download_url}


@dataclasses.dataclass
Expand Down

0 comments on commit ba0e490

Please sign in to comment.