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] merge since, until request parameter with time_range #6251

Conversation

graceguo-supercat
Copy link

@graceguo-supercat graceguo-supercat commented Oct 31, 2018

When exploring, Superset allow request parameter override slice parameter.
There is an issue that slice has time_range parameter, while request has since/until (or vise verse), they didn't merge correct. Example: annotation request like:
http://localhost:8080/superset/slice_json/240?form_data=%7B%22until%22%3A%222008-10-30T00%3A00%3A00%22%7D

@betodealmeida @fabianmenges @michellethomas @kristw

@codecov-io
Copy link

Codecov Report

Merging #6251 into master will increase coverage by 0.43%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6251      +/-   ##
==========================================
+ Coverage   76.85%   77.28%   +0.43%     
==========================================
  Files          47       47              
  Lines        9393    10645    +1252     
==========================================
+ Hits         7219     8227    +1008     
- Misses       2174     2418     +244
Impacted Files Coverage Δ
superset/views/core.py 77.62% <100%> (+3.5%) ⬆️
superset/utils/core.py 88.12% <0%> (-0.18%) ⬇️
superset/db_engine_specs.py 56.18% <0%> (+0.43%) ⬆️
superset/models/core.py 87.19% <0%> (+3.37%) ⬆️
superset/cli.py 40.49% <0%> (+4.49%) ⬆️
superset/utils/cache.py 64.51% <0%> (+16.36%) ⬆️

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 af38d25...bbf71d9. Read the comment docs.

@@ -1032,11 +1032,16 @@ def get_form_data(self, slice_id=None, use_slice_data=False):
slc = db.session.query(models.Slice).filter_by(id=slice_id).first()
slice_form_data = slc.form_data.copy()
# allow form_data in request override slice from_data
if 'time_range' in form_data:
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a comment like: we need to do this here so form_data has precedence over slice for time fields.

Copy link
Author

Choose a reason for hiding this comment

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

done!

@mistercrunch
Copy link
Member

@betodealmeida touched this last, might want an approval from him on this

@betodealmeida
Copy link
Member

LGTM, thanks for fixing this @graceguo-supercat!

@graceguo-supercat graceguo-supercat merged commit 7d8e321 into apache:master Nov 1, 2018
@graceguo-supercat graceguo-supercat deleted the gg-FixTimeRangeParameterOverride branch November 1, 2018 19:41
graceguo-supercat pushed a commit to graceguo-supercat/superset that referenced this pull request Nov 1, 2018
bipinsoniguavus pushed a commit to ThalesGroup/incubator-superset that referenced this pull request Dec 26, 2018
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0 labels Feb 27, 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 🚢 0.34.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants