-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix KeyError parsing for Cuba #2778
Conversation
Does not address source data split
for centre in json_data[centre_type]: | ||
hospital_map[centre] = json_data[centre_type][centre]['nombre'] + \ | ||
", " + json_data[centre_type][centre]['provincia'] | ||
except: |
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.
use except KeyError here - in case some other exception is raised. Also good to use logging.info to print a message saying that key was not found
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.
New commit [6c96b56] deals with this.
if schema_version != 7: | ||
logger.warning( | ||
f'Schema version has been updated from 7 to {schema_version}') | ||
try: |
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.
Was schema-version removed? A change in schema-version should break the script, as we might not be capturing the correct fields.
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.
schema-version was removed. There is no mention of schema-version in covid19-cuba-1.json.
The split of the data into covid19-cuba-{1,2,...}.json, as described in issue #2233 is not addressed by the changes here. Any of the covid19-cuba-{1,2,...}.json files can be parsed by the changes, as well as covid19-cuba-old.json.