fix: time filter db migration optimization#13015
Merged
Merged
Conversation
6f749e9 to
a29817e
Compare
ktmud
commented
Feb 8, 2021
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| from flask_babel import lazy_gettext as _ | ||
| from flask_babel import _ |
Member
Author
There was a problem hiding this comment.
Bycatch, lazy text cannot be properly formatted by Marshmallow.
ktmud
commented
Feb 8, 2021
|
|
||
| def __init__(self) -> None: | ||
| super().__init__(_("Database does not exist"), field_names=["database"]) | ||
| super().__init__(_("Database does not exist"), field_name="database") |
Member
Author
There was a problem hiding this comment.
Bycatch: should use field_name instead of field_names.
Codecov Report
@@ Coverage Diff @@
## master #13015 +/- ##
===========================================
+ Coverage 52.64% 66.97% +14.32%
===========================================
Files 480 489 +9
Lines 17300 28766 +11466
Branches 4481 0 -4481
===========================================
+ Hits 9108 19266 +10158
- Misses 8192 9500 +1308
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
zhaoyongjie
approved these changes
Feb 9, 2021
Member
zhaoyongjie
left a comment
There was a problem hiding this comment.
LGTM, thanks for fixing it!
zhaoyongjie
reviewed
Feb 9, 2021
zhaoyongjie
approved these changes
Feb 9, 2021
amitmiran137
pushed a commit
to simcha90/incubator-superset
that referenced
this pull request
Feb 10, 2021
* master: fix: UI toast typo (apache#13026) feat(db engines): add support for Opendistro Elasticsearch (AWS ES) (apache#12602) fix(build): black failing on master, add to required checks (apache#13039) fix: time filter db migration optimization (apache#13015) fix: untranslated text content of Dashboard page (apache#13024) fix(ci): remove signature requirements for commits to master (apache#13034) fix: add alerts and report to default config (apache#12999) docs(changelog): add entries for 1.0.1 (apache#12981) ci: skip cypress if no code changes (apache#12982) chore: add cypress required checks for branch protection (apache#12970) Refresh dashboard list after bulk delete (apache#12945) Updates storybook to version 6.1.17 (apache#13014) feat: Save datapanel state in local storage (apache#12996) fix: added text and changed margins (apache#12923) chore: Swap Slack Url 2 more places (apache#13004)
amitmiran137
pushed a commit
to nielsen-oss/superset
that referenced
this pull request
Feb 14, 2021
qfcwell
pushed a commit
to qfcwell/superset
that referenced
this pull request
May 12, 2026
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
Optimizes free-text time range filter db migration added by #12505
100 years : 30 years ago. Previously it will incorrectly change it to100 years ago : 30 years laterwhen it should be100 years ago : 30 years ago.These are edge cases nonetheless.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before
When opening a chart with "100 years" (i.e. periods without "ago" or "before/after"), it shows "Fatal error":
After
The error is more actionable:
(Still need some optimization here in order to render the backend validation error more properly but let's do it in another PR for other fields as well. Ideally the backend validation errors should come back to each control based on field name.)
TEST PLAN
#12552 is for fixing legacy charts. You will not be able to add bad data anymore because of the backend validation. You'd need to either find a legacy bad chart, or manually add one. A quick way to do it is this:
For example I use
psql:Note we set the time range to be
"100 years : 30 years ago"/superset/slice/{slice_id}Before migration, you should see the "Unexpected error" when you open the chart.
After migration, you should see the chart render correctly.
Note: if you have already upgraded superset db, you need to downgrade it first:
When in current master, after migration, you will also see the filter being updated to "100 years ago : 30 years later":
With this PR, after migration, you should see the filter being updated to "100 years ago : 30 years ago":
ADDITIONAL INFORMATION