-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
[SIP-15] Fix time range endpoints decoding #8481
Conversation
6defd98
to
6aa1661
Compare
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
6aa1661
to
bd0fd40
Compare
|
||
if time_range_endpoints: | ||
return time_range_endpoints | ||
if slc and not endpoints: |
There was a problem hiding this comment.
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.
bd0fd40
to
6e2f440
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
(cherry picked from commit eb150eb)
CATEGORY
Choose one
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