Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
[DeckGL] Raise error with null values (apache#5302)
Browse files Browse the repository at this point in the history
* raise errors with null values

* linting

* linting some more

* use get

* change ordering

* linting
  • Loading branch information
hughhhh authored and timifasubaa committed Jul 25, 2018
1 parent 9e6e504 commit a71980c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions superset/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@ class NoDataException(SupersetException):
status = 400


class NullValueException(SupersetException):
status = 400


class SupersetTemplateException(SupersetException):
pass
6 changes: 6 additions & 0 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
from six.moves import cPickle as pkl, reduce

from superset import app, cache, get_manifest_file, utils
from superset.exceptions import NullValueException
from superset.utils import DTTM_ALIAS, JS_MAX_INTEGER, merge_extra_filters


Expand Down Expand Up @@ -2107,6 +2108,11 @@ def tupleify(s):
df[key] = list(zip(latlong.apply(lambda x: x[0]),
latlong.apply(lambda x: x[1])))
del df[spatial.get('geohashCol')]

if df.get(key) is None:
raise NullValueException(_('Encountered invalid NULL spatial entry, \
please consider filtering those out'))

return df

def query_obj(self):
Expand Down

0 comments on commit a71980c

Please sign in to comment.