-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
[DeckGL] Raise error with null values #5302
Conversation
superset/viz.py
Outdated
@@ -2107,6 +2108,10 @@ 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[key] is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(optional)df.get(key) is None:
would protect against KeyError (not sure if they're possible in this context)
superset/viz.py
Outdated
@@ -2107,6 +2108,10 @@ 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[key] is None: | |||
raise NullValueException('Some rows in this query contain NULL values!') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Msg could be a bit more precise and use i18n wrapper: _(Encountered invalid NULL spatial entry, please consider filtering those out)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vylc wording ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a python lib for i18n
? i thought is was only available for JS, i was searching the code for some example and couldn't find any.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this module it's available from the line from flask_babel import lazy_gettext as _
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the setup is kind of sweet where we use the same framework for both the backend and frontend.
LGTM |
Codecov Report
@@ Coverage Diff @@
## master #5302 +/- ##
==========================================
+ Coverage 61.31% 61.32% +0.01%
==========================================
Files 369 369
Lines 23468 23488 +20
Branches 2717 2717
==========================================
+ Hits 14390 14405 +15
- Misses 9066 9071 +5
Partials 12 12
Continue to review full report at Codecov.
|
* raise errors with null values * linting * linting some more * use get * change ordering * linting (cherry picked from commit 089037f)
* raise errors with null values * linting * linting some more * use get * change ordering * linting (cherry picked from commit 089037f)
* raise errors with null values * linting * linting some more * use get * change ordering * linting (cherry picked from commit 089037f)
* raise errors with null values * linting * linting some more * use get * change ordering * linting (cherry picked from commit 089037f)
* raise errors with null values * linting * linting some more * use get * change ordering * linting (cherry picked from commit 089037f)
* raise errors with null values * linting * linting some more * use get * change ordering * linting (cherry picked from commit 089037f)
* raise errors with null values * linting * linting some more * use get * change ordering * linting (cherry picked from commit 089037f)
* raise errors with null values * linting * linting some more * use get * change ordering * linting (cherry picked from commit 089037f)
* raise errors with null values * linting * linting some more * use get * change ordering * linting (cherry picked from commit 089037f)
* raise errors with null values * linting * linting some more * use get * change ordering * linting
* raise errors with null values * linting * linting some more * use get * change ordering * linting (cherry picked from commit 089037f)
* raise errors with null values * linting * linting some more * use get * change ordering * linting (cherry picked from commit 089037f)
* raise errors with null values * linting * linting some more * use get * change ordering * linting (cherry picked from commit 089037f)
* raise errors with null values * linting * linting some more * use get * change ordering * linting (cherry picked from commit 089037f)
* raise errors with null values * linting * linting some more * use get * change ordering * linting (cherry picked from commit 089037f)
* raise errors with null values * linting * linting some more * use get * change ordering * linting (cherry picked from commit 089037f)
* raise errors with null values * linting * linting some more * use get * change ordering * linting (cherry picked from commit 089037f)
* raise errors with null values * linting * linting some more * use get * change ordering * linting (cherry picked from commit 089037f)
* raise errors with null values * linting * linting some more * use get * change ordering * linting (cherry picked from commit 089037f)
* raise errors with null values * linting * linting some more * use get * change ordering * linting
Really vague message with null values. Want to be more transparent about the errors in the underlying code for showing data in deckgl
@mistercrunch