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)
  • Loading branch information
mistercrunch authored and xtinec committed Jan 23, 2019
1 parent a2b2852 commit 8b93ead
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions superset/assets/src/visualizations/deckgl/layers/common.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import * as d3array from 'd3-array';
import sandboxedEval from '../../../modules/sandbox';

export function getBounds(points) {
const latExt = d3array.extent(points, d => d[1]);
const lngExt = d3array.extent(points, d => d[0]);
const latExt = d3array.extent(points, d => d ? d[1] : null);
const lngExt = d3array.extent(points, d => d? d[0] : null);
return [
[lngExt[0], latExt[0]],
[lngExt[1], latExt[1]],
Expand Down
5 changes: 3 additions & 2 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -2358,7 +2358,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 @@ -2486,7 +2487,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 8b93ead

Please sign in to comment.