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 8, 2019
1 parent 22d3653 commit 0f935e9
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 @@ -21,8 +21,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 @@ -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 0f935e9

Please sign in to comment.