Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harvest support range dates separated by dashes #2892

Merged
merged 4 commits into from
Jun 5, 2019

Conversation

dharizza
Copy link
Contributor

@dharizza dharizza commented Jun 4, 2019

Harvest sources https://data.cdc.gov/data.json with temporal coverage dates that use dashes as separator are failing with the following error:

Error: Call to a member function getTimestamp() on null in       [error]
DatajsonHarvestMigration->prepareRow() (line 201 of
dkan/modules/dkan/dkan_harvest/modules/dkan_harvest_datajson/dkan_harvest_datajson.migrate.inc).
Error: Call to a member function getTimestamp() on null in DatajsonHarvestMigration->prepareRow() (line 201 of dkan/modules/dkan/dkan_harvest/modules/dkan_harvest_datajson/dkan_harvest_datajson.migrate.inc).
Drush command terminated abnormally due to an unrecoverable error.       [error]
Error: DateTime::__construct(): Failed to parse time string
(1899-2017) at position 6 (0): Unexpected character in
dkan/modules/dkan/dkan_harvest/modules/dkan_harvest_datajson/dkan_harvest_datajson.migrate.inc,
line 189

This is because dkan_harvest doesn't support temporal coverage values following the format "YYYY-YYYY". As it is a common format, in this PR we are adding support for it, so any harvest source with a temporal coverage value using the format YYYY-YYYY should work correctly just as any other YYYY/YYYY rage dates.

How to reproduce

  1. Run harvest for a harvest source with temporal coverage values using the format YYYY-YYYY, it should fail with the message above. For example in https://data.cdc.gov/data.json the dataset with identifier https://data.cdc.gov/api/views/66i6-hisz

QA Steps

@janette janette merged commit 4eb23c2 into 7.x-1.x Jun 5, 2019
@janette janette deleted the harvest-support-range-dates branch June 5, 2019 20:02
dafeder pushed a commit that referenced this pull request Apr 24, 2020
* Support date range separated by dashes.

* Use value_date just if it is set.

* Add back support for only year dates.

* Added test for checking support of dates in format YYYY-YYYY as temporal coverage value.
dafeder pushed a commit that referenced this pull request Apr 24, 2020
* Support date range separated by dashes.

* Use value_date just if it is set.

* Add back support for only year dates.

* Added test for checking support of dates in format YYYY-YYYY as temporal coverage value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants