fix(chart): allow null for optional query object props#12905
Merged
ktmud merged 1 commit intoapache:masterfrom Feb 3, 2021
Merged
fix(chart): allow null for optional query object props#12905ktmud merged 1 commit intoapache:masterfrom
null for optional query object props#12905ktmud merged 1 commit intoapache:masterfrom
Conversation
6066edb to
521450d
Compare
521450d to
6c4a999
Compare
betodealmeida
approved these changes
Feb 3, 2021
Member
betodealmeida
left a comment
There was a problem hiding this comment.
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"
Member
Author
|
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.
|
amitmiran137
pushed a commit
to nielsen-oss/superset
that referenced
this pull request
Feb 3, 2021
* 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) ...
villebro
pushed a commit
to preset-io/superset
that referenced
this pull request
Feb 4, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
This is probably a little controversial, too.
Sometimes chart plugin
buildQuerygenerates invalidnullvalues 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: nullcan still load and it has the same cache key as whengranularityis not set.`Manually tested by sending API request with null values to
/api/v1/chart/data{ "datasource": { "id": 27, "type": "table" }, "force": false, "queries": [ { "time_range": null, "filters": null, "columns": [ "season", "episode", "TITLE" ], "metrics": null, "orderby": null, "row_limit": null, "timeseries_limit": null, "order_desc": null, "url_params": null, "post_processing": null } ], "result_format": "json", "result_type": "full" }ADDITIONAL INFORMATION