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

Avoid KeyError when tile schema has changed #825

Merged
merged 1 commit into from
Sep 12, 2018
Merged

Conversation

hvelarde
Copy link
Member

if field_name not in fields:
continue # tile schema has changed

if not isinstance(field_conf, dict):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in what case this is not a dict?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Pdb) pp conf.items()
[('css_class', ''),
 ('link_url', {'htmltag': u'h2', 'order': u'2', 'visibility': u'on'}),
 ('link_text', {'htmltag': u'h2', 'order': u'1', 'visibility': u'on'}),
 ('title', {'htmltag': u'h2', 'order': u'0', 'visibility': u'on'})]

@hvelarde hvelarde merged commit 363bd05 into master Sep 12, 2018
@hvelarde hvelarde deleted the hvelarde/keyerror branch September 12, 2018 02:23
@hvelarde
Copy link
Member Author

I'm going to do it later: this is an issue on brasil.gov.tiles for IDG 1.2 and we're not responsible for that.

I'm still not pretty sure on how to fix it; we will probably need a monkey patch.

@idgserpro
Copy link
Member

@hvelarde after run the upgrade, tell us if this did not cause inconsistencies.

@hvelarde
Copy link
Member Author

I already did it and I saw no issues: it just skips any field no longer present in the tile schema.

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.

3 participants