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: Removetime_range_endpoints from query context object pt 2 #19728

Merged
merged 3 commits into from
Apr 15, 2022

Conversation

hughhhh
Copy link
Member

@hughhhh hughhhh commented Apr 14, 2022

SUMMARY

original reference this time we actually save the data properly 😪
#19423

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

@hughhhh hughhhh requested a review from a team as a code owner April 14, 2022 21:49
@codecov
Copy link

codecov bot commented Apr 14, 2022

Codecov Report

Merging #19728 (e882498) into master (9407598) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master   #19728   +/-   ##
=======================================
  Coverage   66.51%   66.51%           
=======================================
  Files        1686     1686           
  Lines       64591    64591           
  Branches     6636     6636           
=======================================
  Hits        42961    42961           
  Misses      19931    19931           
  Partials     1699     1699           
Flag Coverage Δ
hive 52.69% <ø> (ø)
mysql 81.95% <ø> (ø)
postgres 82.00% <ø> (ø)
presto 52.54% <ø> (ø)
python 82.43% <ø> (ø)
sqlite 81.76% <ø> (ø)
unit 47.75% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out 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 9407598...e882498. Read the comment docs.

queries = query_context.get("queries")
for q in queries:
extras = q.get("extras", {})
assert "time_range_endpoints" not in extras
Copy link
Member

Choose a reason for hiding this comment

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

nice! A test on a migration!

"datasource": "27__table",
"slice_id": 545,
"url_params": {},
"time_range_endpoints": ["inclusive", "exclusive"],
Copy link
Member

Choose a reason for hiding this comment

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

total nit, but technically this wouldn't be on this payload.

@ktmud
Copy link
Member

ktmud commented Apr 15, 2022

maybe not necessary, but if the original migration doesn't work, maybe we can change it to noop?

try:
query_context = json.loads(slc.query_context)
except json.decoder.JSONDecodeError:
pass
Copy link
Member

Choose a reason for hiding this comment

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

You should return here, as the json parse failed

}


def test_upgrade():
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a test for the case when the query_context is non-json?

@hughhhh hughhhh merged commit 8664202 into master Apr 15, 2022
sadpandajoe pushed a commit to preset-io/superset that referenced this pull request Apr 15, 2022
@sadpandajoe
Copy link
Member

🏷️ preset:2022.15

philipher29 pushed a commit to ValtechMobility/superset that referenced this pull request Jun 9, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.0.0 labels Mar 13, 2024
@mistercrunch mistercrunch deleted the rm_time_range_endpoints_2 branch March 26, 2024 16:20
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:2022.15 size/L 🚢 2.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants