-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
feat: Logic added to limiting factor column in Query model #13521
Conversation
dc48414
to
bfa3b05
Compare
superset/migrations/versions/b5676c717e8b_add_new_columns_to_query_model.py
Outdated
Show resolved
Hide resolved
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.
Looks good! Did you get a chance to test the migration by running superset db upgrade
?
I just did, and it seemed to go through. (Also happy birthday!) |
1472ac2
to
c902b3e
Compare
❗ Please consider rebasing your branch to avoid db migration conflicts. |
❗ Please consider rebasing your branch to avoid db migration conflicts. |
4 similar comments
❗ Please consider rebasing your branch to avoid db migration conflicts. |
❗ Please consider rebasing your branch to avoid db migration conflicts. |
❗ Please consider rebasing your branch to avoid db migration conflicts. |
❗ Please consider rebasing your branch to avoid db migration conflicts. |
d120ca4
to
aa899de
Compare
Codecov Report
@@ Coverage Diff @@
## master #13521 +/- ##
==========================================
- Coverage 76.92% 76.68% -0.24%
==========================================
Files 955 955
Lines 48055 48080 +25
Branches 6033 6034 +1
==========================================
- Hits 36967 36871 -96
- Misses 10890 11011 +121
Partials 198 198
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
❗ Please consider rebasing your branch to avoid db migration conflicts. |
@AAfghahi do you want to split this PR into migration + For the |
@betodealmeida that makes sense, so then should I move everything that isn't the migration to another PR? And then add unit tests to the limiting factor one? |
Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
36a4c63
to
9214621
Compare
9214621
to
54bddb2
Compare
Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
e9d2b3c
to
57ceca3
Compare
* master: (38 commits) refactor(native-filters): allow cascading only for filter_select (apache#14441) test(maximize-chart): Add tests to maximize chart action (apache#14371) fix: fixing mysql error message (apache#14416) feat: Logic added to limiting factor column in Query model (apache#13521) change relationship (apache#14435) fix: bootstrap data permissions (apache#14348) fix: parse simple string error message values (apache#14360) chore: add stack trace to all calls of logger.error (apache#14382) update README with new docs and recordings (apache#14432) Renamed impyla from implya in impala.mdx and Renamed PIP package impyla from impala in index.mdx (apache#14425) fix(native-filters): fix filter scope error (apache#14426) feat: Adding limiting_factor column to Query model (apache#14234) feat: Add etag caching to dashboard APIs (apache#14357) chore: Moves Card to the components folder (apache#14139) feat: Dynamic imports for the Icons component (apache#14318) feat: Support env vars configuration for WebSocket server (apache#14398) fix: SQLLab role permissions (apache#14372) fix(native-filters): always show filters without dataset (apache#14409) fix error getting partitionQuery from table.partition (apache#14369) refactor: Boostrap to AntD - Tabs (apache#14048) ...
* Sqllab limit * Add migration script * Set default values * initial push * revisions * Update superset/views/core.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * moving migration to separate PR * with migration * revisions * Fix apply_limit_to_sql * all but tests * added unit tests * revisions * Update superset/sql_lab.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * Update superset/sql_parse.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * fixed black issue * Update superset/views/core.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * updated logic Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> (cherry picked from commit e507508)
* Sqllab limit * Add migration script * Set default values * initial push * revisions * Update superset/views/core.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * moving migration to separate PR * with migration * revisions * Fix apply_limit_to_sql * all but tests * added unit tests * revisions * Update superset/sql_lab.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * Update superset/sql_parse.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * fixed black issue * Update superset/views/core.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * updated logic Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
) * Sqllab limit * Add migration script * Set default values * initial push * revisions * Update superset/views/core.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * moving migration to separate PR * with migration * revisions * Fix apply_limit_to_sql * all but tests * added unit tests * revisions * Update superset/sql_lab.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * Update superset/sql_parse.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * fixed black issue * Update superset/views/core.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * updated logic Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> (cherry picked from commit e507508)
) * Sqllab limit * Add migration script * Set default values * initial push * revisions * Update superset/views/core.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * moving migration to separate PR * with migration * revisions * Fix apply_limit_to_sql * all but tests * added unit tests * revisions * Update superset/sql_lab.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * Update superset/sql_parse.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * fixed black issue * Update superset/views/core.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * updated logic Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> (cherry picked from commit e507508)
) * Sqllab limit * Add migration script * Set default values * initial push * revisions * Update superset/views/core.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * moving migration to separate PR * with migration * revisions * Fix apply_limit_to_sql * all but tests * added unit tests * revisions * Update superset/sql_lab.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * Update superset/sql_parse.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * fixed black issue * Update superset/views/core.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * updated logic Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
) * Sqllab limit * Add migration script * Set default values * initial push * revisions * Update superset/views/core.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * moving migration to separate PR * with migration * revisions * Fix apply_limit_to_sql * all but tests * added unit tests * revisions * Update superset/sql_lab.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * Update superset/sql_parse.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * fixed black issue * Update superset/views/core.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * updated logic Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
) * Sqllab limit * Add migration script * Set default values * initial push * revisions * Update superset/views/core.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * moving migration to separate PR * with migration * revisions * Fix apply_limit_to_sql * all but tests * added unit tests * revisions * Update superset/sql_lab.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * Update superset/sql_parse.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * fixed black issue * Update superset/views/core.py Co-authored-by: Beto Dealmeida <roberto@dealmeida.net> * updated logic Co-authored-by: Beto Dealmeida <roberto@dealmeida.net>
SUMMARY
This is the logic for the migration that can be found here: #14234
What this does is that it assigns one of five categories to each query based on if there is a limiting factor in the results that the query is grabbing. This is in order to create more intelligent error messages in the superset frontend.
Reason
Will be used in the frontend for better user facing messages. Previously several users had complained that they had downloaded the CSV of a query not realizing that the query had been limited either by the dropdown select or their own query parameters. This column will address using backend logic to determine what type of limiting factor, if any, has been placed on the query.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TEST PLAN
Added unit tests!
ADDITIONAL INFORMATION