-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
fix(chart): allow null
for optional query object props
#12905
Conversation
6066edb
to
521450d
Compare
521450d
to
6c4a999
Compare
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.
I think is good. In general I try to follow Postel's Law: "Be conservative in what you send, be liberal in what you accept"
That's a good quote! |
Codecov Report
@@ Coverage Diff @@
## master #12905 +/- ##
==========================================
- Coverage 66.98% 66.56% -0.43%
==========================================
Files 1026 1026
Lines 50330 50744 +414
Branches 5189 5361 +172
==========================================
+ Hits 33713 33777 +64
- Misses 16483 16832 +349
- Partials 134 135 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
* master: (23 commits) feat(explore): clear search on dataset change (apache#12909) chore: remove SIP-38 feature flag (apache#12894) fix: Config for dataset health check (apache#12906) fix(chart): allow null for most query object props (apache#12905) feat: add separate endpoint to fetch function names for autocomplete (apache#12840) chore: add required review on master (apache#12694) fix: comment typo (apache#12898) Migrates Radio component from Bootstrap to AntD. (apache#12738) fix: allow users to reset their passwords (apache#12886) fix(explore): missing select when groupby without metrics (apache#12890) refactor: dbapi exception mapping for dbapi's (apache#12869) feat(style-theme): add support for custom superset themes (apache#12858) chore(lint): fix pre-commit error (apache#12884) refactor(color-schemes): refactor setting of color schemes (apache#12857) feat(native-filters): Add defaultValue for Native filters modal (apache#12199) feat(release): add github token to changelog script (apache#12872) fix(menu): always show settings dropdown (apache#12877) Migrates Label component from Bootstrap to AntD. (apache#12774) [Helm] Automate datasource import (apache#10771) build: Skip loading example data from configs in CI (apache#12610) ...
SUMMARY
This is probably a little controversial, too.
Sometimes chart plugin
buildQuery
generates invalidnull
values for certain props (either because of sloppy code or uncleaned legacy data), making the whole query fails:Since most of the props are optional anyway, maybe we should just make the backend more error-tolerant by allowing
null
(None
) everywhere possible.TEST PLAN
Added a unit test to check a query with
granularity: null
can still load and it has the same cache key as whengranularity
is not set.`Manually tested by sending API request with null values to
/api/v1/chart/data
ADDITIONAL INFORMATION