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

fix: encode rison characters when searching #16768

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

betodealmeida
Copy link
Member

SUMMARY

When searching for charts/dashboards/datasets we're currently getting an error if the needle has a plus symbol, eg, /w+. This happens because the + is not escaped, and gets sent as a space to the backend. Because the string /w is not valid rison, the search fails.

I fixed by explicitly encoding +. We could use encodeURIComponent, but it encodes more than is needed and pollutes the URL.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before:

Screenshot 2021-09-21 at 13-12-51  DEV  Superset

After:

Screenshot 2021-09-21 at 14-14-47  DEV  Superset

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

@codecov
Copy link

codecov bot commented Sep 21, 2021

Codecov Report

Merging #16768 (723759a) into master (092ef5b) will decrease coverage by 0.24%.
The diff coverage is 87.90%.

❗ Current head 723759a differs from pull request most recent head 2b01a95. Consider uploading reports for the commit 2b01a95 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16768      +/-   ##
==========================================
- Coverage   76.99%   76.74%   -0.25%     
==========================================
  Files        1007     1007              
  Lines       54133    54186      +53     
  Branches     7374     7464      +90     
==========================================
- Hits        41678    41584      -94     
- Misses      12215    12362     +147     
  Partials      240      240              
Flag Coverage Δ
hive ?
javascript 71.28% <87.50%> (-0.02%) ⬇️
presto ?

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

Impacted Files Coverage Δ
...rontend/src/SqlLab/components/ShareSqlLabQuery.tsx 88.37% <ø> (ø)
superset/common/query_actions.py 92.53% <ø> (-0.52%) ⬇️
superset/config.py 91.44% <ø> (-0.03%) ⬇️
superset/datasets/commands/importers/v1/utils.py 59.25% <0.00%> (-0.75%) ⬇️
superset/db_engine_specs/base.py 88.20% <ø> (-0.20%) ⬇️
superset/db_engine_specs/bigquery.py 86.84% <66.66%> (-0.92%) ⬇️
...rontend/src/SqlLab/components/AceEditorWrapper.tsx 58.75% <75.00%> (-0.75%) ⬇️
superset/connectors/sqla/models.py 86.31% <75.75%> (-3.39%) ⬇️
superset/reports/commands/execute.py 90.83% <77.77%> (+0.60%) ⬆️
superset/common/query_object.py 94.44% <97.05%> (+3.77%) ⬆️
... and 25 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 092ef5b...2b01a95. Read the comment docs.

@betodealmeida betodealmeida merged commit 4af5ae0 into apache:master Sep 22, 2021
opus-42 pushed a commit to opus-42/incubator-superset that referenced this pull request Nov 14, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 28, 2021
@rumbin
Copy link
Contributor

rumbin commented Feb 1, 2022

@betodealmeida
We are observing similar Not a valid rison/json argument errors when searching for [ or {.
Not sure if this fix is in Superset 1.4.0. If so, I will file a new issue for this...

@rumbin
Copy link
Contributor

rumbin commented Feb 1, 2022

Related: #18056

@mistercrunch mistercrunch added 🏷️ 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 size/S 🚢 1.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants