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(jinja): improve url parameter formatting #16711

Merged
merged 3 commits into from
Sep 15, 2021

Conversation

villebro
Copy link
Member

@villebro villebro commented Sep 15, 2021

SUMMARY

Add handling of special characters to URL param function in Jinja context to improve cross-database filter clause compatibility. This is done by adding the parameter escape_result to the url_param function which defaults to True. When enabled, it escapes the value of the requested url param using the relevant SQLAlchemy dialect for the selected database.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • 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

@villebro villebro force-pushed the villebro/quote-jinja branch from f94cdfa to c7fbe85 Compare September 15, 2021 11:45
@codecov
Copy link

codecov bot commented Sep 15, 2021

Codecov Report

Merging #16711 (340d87d) into master (b0ac5d1) will decrease coverage by 0.19%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16711      +/-   ##
==========================================
- Coverage   76.93%   76.73%   -0.20%     
==========================================
  Files        1007     1007              
  Lines       54146    54152       +6     
  Branches     7369     7369              
==========================================
- Hits        41655    41552     -103     
- Misses      12251    12360     +109     
  Partials      240      240              
Flag Coverage Δ
hive ?
mysql 81.68% <100.00%> (+0.04%) ⬆️
postgres 81.74% <100.00%> (+0.04%) ⬆️
presto ?
python 81.83% <100.00%> (-0.39%) ⬇️
sqlite 81.35% <100.00%> (+0.04%) ⬆️

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

Impacted Files Coverage Δ
superset/jinja_context.py 89.69% <100.00%> (+0.32%) ⬆️
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/views/database/mixins.py 81.03% <0.00%> (-1.73%) ⬇️
superset/connectors/sqla/models.py 88.04% <0.00%> (-1.66%) ⬇️
superset/models/core.py 89.00% <0.00%> (-0.75%) ⬇️
superset/db_engine_specs/base.py 88.00% <0.00%> (-0.39%) ⬇️
superset/utils/core.py 89.76% <0.00%> (-0.13%) ⬇️
superset/common/query_context.py 90.74% <0.00%> (+1.85%) ⬆️
... and 1 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 b0ac5d1...340d87d. Read the comment docs.

@villebro villebro force-pushed the villebro/quote-jinja branch from 340d87d to 5be48ce Compare September 15, 2021 14:01
@villebro villebro merged commit 88c09c2 into apache:master Sep 15, 2021
@villebro villebro deleted the villebro/quote-jinja branch September 15, 2021 17:01
@villebro villebro added the v1.3 label Sep 15, 2021
stevenuray pushed a commit to preset-io/superset that referenced this pull request Sep 17, 2021
* feat(jinja): improve url parameter formatting

* add UPDATING.md

* fix test

(cherry picked from commit 88c09c2)
villebro added a commit that referenced this pull request Sep 22, 2021
* feat(jinja): improve url parameter formatting

* add UPDATING.md

* fix test
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
* feat(jinja): improve url parameter formatting

* add UPDATING.md

* fix test
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
* feat(jinja): improve url parameter formatting

* add UPDATING.md

* fix test
@mistercrunch mistercrunch added 🍒 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-io size/M v1.3 🍒 1.3.1 🍒 1.3.2 🚢 1.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants