-
Notifications
You must be signed in to change notification settings - Fork 54
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
Fixed date parsing while fetching entries for task_status #179
Fixed date parsing while fetching entries for task_status #179
Conversation
…uhammed-ajmal/ckanext-xloader into dateformat-fix-for-task-status-entries
|
ckanext/xloader/action.py
Outdated
existing_task['last_updated'], '%Y-%m-%dT%H:%M:%S.%f') | ||
|
||
# Parse date format from the following valid dates | ||
date_formats = ['%Y-%m-%dT%H:%M:%S', '%Y-%m-%dT%H:%M:%S.%f'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are both ISO formats. Perhaps dateutil.parser.isoparse would be simpler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated with that, do we need to add this inside a try-except block?
log.exception('Invalid last_updated date for entity_id=%s', res_id) | ||
return False | ||
|
||
updated = parse_date(existing_task['last_updated']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't isoparse
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, please check the latest commit.
ckanext-xloader/ckanext/xloader/action.py
Line 103 in 96164ba
updated = parse_iso_date(existing_task['last_updated']) |
Found issues while parsing the
last_updated
date from thetask_status
table.last_updated
date without microseconds as ckan APIs are not promising the date will always include microseconds.Error logs