Skip to content
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: change query predicate to text #16160

Merged

Conversation

eschutho
Copy link
Member

@eschutho eschutho commented Aug 10, 2021

SUMMARY

changes query predicate to text to accommodate longer strings

Closes #16100

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

_DEV__Superset

TESTING INSTRUCTIONS

Results from migration script:
Current: 0.34 s
10+: 0.22 s
100+: 0.23 s
1000+: 0.37 s

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@eschutho eschutho requested a review from a team as a code owner August 10, 2021 00:52
@eschutho eschutho marked this pull request as draft August 10, 2021 00:52
@eschutho eschutho changed the title change query predicate to text feat: change query predicate to text Aug 10, 2021
@codecov
Copy link

codecov bot commented Aug 10, 2021

Codecov Report

Merging #16160 (1944a03) into master (606a7bf) will decrease coverage by 0.26%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16160      +/-   ##
==========================================
- Coverage   76.82%   76.55%   -0.27%     
==========================================
  Files         996      996              
  Lines       52940    52940              
  Branches     6732     6732              
==========================================
- Hits        40670    40529     -141     
- Misses      12045    12186     +141     
  Partials      225      225              
Flag Coverage Δ
hive ?
mysql ?
postgres 81.54% <100.00%> (-0.05%) ⬇️
presto ?
python 81.59% <100.00%> (-0.52%) ⬇️
sqlite 81.19% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...erset-frontend/src/datasource/DatasourceEditor.jsx 74.25% <100.00%> (ø)
superset/connectors/sqla/models.py 88.08% <100.00%> (-1.67%) ⬇️
superset/db_engines/hive.py 0.00% <0.00%> (-82.15%) ⬇️
superset/db_engine_specs/hive.py 69.80% <0.00%> (-16.87%) ⬇️
superset/db_engine_specs/presto.py 83.47% <0.00%> (-6.91%) ⬇️
superset/db_engine_specs/mysql.py 94.04% <0.00%> (-3.58%) ⬇️
superset/utils/date_parser.py 93.13% <0.00%> (-3.44%) ⬇️
superset/common/query_context.py 88.88% <0.00%> (-1.86%) ⬇️
superset/views/database/mixins.py 81.03% <0.00%> (-1.73%) ⬇️
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 606a7bf...1944a03. Read the comment docs.

@mistercrunch mistercrunch added the risk:db-migration PRs that require a DB migration label Aug 10, 2021
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the fix!

@github-actions
Copy link
Contributor

⚠️ @eschutho Your base branch master has just also updated superset/migrations.

Please consider rebasing your branch to avoid db migration conflicts.

@eschutho eschutho force-pushed the elizabeth/change-query-predicate-to-text branch from 51eaf08 to 25e9041 Compare August 10, 2021 17:56
@eschutho eschutho marked this pull request as ready for review August 10, 2021 20:49
.pylintrc Outdated
@@ -251,7 +251,7 @@ expected-line-ending-format=
# Logging modules to check that the string format arguments are in logging
# function parameter format
logging-modules=logging

disable=logging-fstring-interpolation
Copy link
Member

@betodealmeida betodealmeida Aug 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
disable=logging-fstring-interpolation

Using f-strings with logging is not considered safe because if the string interpolation fails nothing gets logged. if you use the old-school string interpolation then the message always get logged, even if the interpolation fails.

for row in rows:
row.fetch_values_predicate = None

logging.info(f"{len(rows)} values deleted")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
logging.info(f"{len(rows)} values deleted")
logging.info("%d values deleted", len(rows))

@eschutho eschutho force-pushed the elizabeth/change-query-predicate-to-text branch from 6677923 to c4f44ca Compare August 10, 2021 22:48
@eschutho eschutho force-pushed the elizabeth/change-query-predicate-to-text branch from c4f44ca to 3ab46fb Compare August 10, 2021 22:49
@betodealmeida betodealmeida merged commit 628169a into apache:master Aug 11, 2021
@villebro villebro deleted the elizabeth/change-query-predicate-to-text branch August 11, 2021 06:02
stevenuray pushed a commit to preset-io/superset that referenced this pull request Aug 11, 2021
* change query predicate to text

* make input multiline

* remove value that is too long for the downgrade

* keep logging lint rule

(cherry picked from commit 628169a)
@villebro villebro added the v1.3 label Aug 16, 2021
villebro pushed a commit that referenced this pull request Aug 16, 2021
* change query predicate to text

* make input multiline

* remove value that is too long for the downgrade

* keep logging lint rule

(cherry picked from commit 628169a)
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
* change query predicate to text

* make input multiline

* remove value that is too long for the downgrade

* keep logging lint rule
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
* change query predicate to text

* make input multiline

* remove value that is too long for the downgrade

* keep logging lint rule

(cherry picked from commit 628169a)
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
* change query predicate to text

* make input multiline

* remove value that is too long for the downgrade

* keep logging lint rule
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* change query predicate to text

* make input multiline

* remove value that is too long for the downgrade

* keep logging lint rule

(cherry picked from commit 628169a)
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* change query predicate to text

* make input multiline

* remove value that is too long for the downgrade

* keep logging lint rule

(cherry picked from commit c345885)
@mistercrunch mistercrunch added 🍒 1.3.0 🍒 1.3.1 🍒 1.3.2 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.4.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels preset:2021.31 preset-io risk:db-migration PRs that require a DB migration size/M v1.3 🍒 1.3.0 🍒 1.3.1 🍒 1.3.2 🚢 1.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[explore]Change the textbox for autocomplete query predicate as a multiline text input
5 participants