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

[SIP-15] Fix time range endpoints decoding #8481

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented Oct 30, 2019

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

Python tuples (which is how the time range endpoints are defined) are encoded as JSON arrays and thus when the form data is decoded we need to re-encode this as a tuple especially for comparison reasons.

This PR also ensures that the endpoints if present in the JSON form-data are decoded using the enum (as opposed to string) for consistency.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TEST PLAN

Manual testing.

ADDITIONAL INFORMATION

REVIEWERS

to: @etr2460 @graceguo-supercat @michellethomas @villbro

@john-bodley john-bodley changed the title [sip-15] Fix time range endpoints decoding [SIP-15] Fix time range endpoints decoding Oct 30, 2019
@john-bodley john-bodley force-pushed the john-bodley--sip-15-fix-time-range-endpoints-encoding branch from 6defd98 to 6aa1661 Compare October 30, 2019 18:07
@codecov-io
Copy link

codecov-io commented Oct 30, 2019

Codecov Report

Merging #8481 into master will increase coverage by 0.06%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8481      +/-   ##
==========================================
+ Coverage   66.54%   66.61%   +0.06%     
==========================================
  Files         449      449              
  Lines       22609    22608       -1     
  Branches     2367     2367              
==========================================
+ Hits        15046    15060      +14     
+ Misses       7425     7410      -15     
  Partials      138      138
Impacted Files Coverage Δ
superset/views/utils.py 90.47% <100%> (+14.06%) ⬆️

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 06a4108...6e2f440. Read the comment docs.

@john-bodley john-bodley force-pushed the john-bodley--sip-15-fix-time-range-endpoints-encoding branch from 6aa1661 to bd0fd40 Compare October 30, 2019 22:02

if time_range_endpoints:
return time_range_endpoints
if slc and not endpoints:
Copy link
Member Author

Choose a reason for hiding this comment

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

This is really just a refactor of the old logic to ensure that we're not repeating ourselves when defining the interval.

@pull-request-size pull-request-size bot added size/S and removed size/M labels Oct 31, 2019
@john-bodley john-bodley force-pushed the john-bodley--sip-15-fix-time-range-endpoints-encoding branch from bd0fd40 to 6e2f440 Compare October 31, 2019 05:49
Copy link

@graceguo-supercat graceguo-supercat left a comment

Choose a reason for hiding this comment

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

LGTM!

@john-bodley john-bodley merged commit eb150eb into apache:master Oct 31, 2019
john-bodley added a commit to john-bodley/superset that referenced this pull request Oct 31, 2019
@dpgaspar dpgaspar added v0.35 and removed v0.35 labels Dec 20, 2019
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.36.0 labels Feb 28, 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 🚢 0.36.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants