Skip to content

Commit

Permalink
Fix missing zipcode bug
Browse files Browse the repository at this point in the history
(cherry picked from commit c0bf1d2)
(cherry picked from commit 8b93ead)
(cherry picked from commit 50fb6b7)
(cherry picked from commit 31e8345)
(cherry picked from commit 56bb3b9)
  • Loading branch information
mistercrunch authored and betodealmeida committed Apr 10, 2019
1 parent 3eaa543 commit d575ccb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -2383,7 +2383,8 @@ def zipcode_deser(zipcodes):
geojson = zipcodes_to_json(zipcodes)

def deser(zipcode):
return geojson[str(zipcode)]['coordinates'][0]
if str(zipcode) in geojson:
return geojson[str(zipcode)]['coordinates'][0]
return deser


Expand Down Expand Up @@ -2511,7 +2512,7 @@ def get_properties(self, d):
line_type = fd.get('line_type')
deser = self.deser_map[line_type]
line_column = fd.get('line_column')
path = deser(d[line_column])
path = deser(d[line_column]) or []
if fd.get('reverse_long_lat'):
path = [(o[1], o[0]) for o in path]
d[self.deck_viz_key] = path
Expand Down

0 comments on commit d575ccb

Please sign in to comment.