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

[annotation] Only allow override whole time_range #6286

Conversation

graceguo-supercat
Copy link

@graceguo-supercat graceguo-supercat commented Nov 6, 2018

screen shot 2018-11-06 at 5 20 57 pm

This PR is related with #6251.

Before time_range we used since, until parameters. And in annotation layer UI we allow user to override since, or until, or both. But after we introduced time_range, it offers many framed time range string like Last day, Last 3 month etc. in #6251, i tried to merge old since until into time_range, but today we found there are so many cases that no simple solution to cover all. So @michellethomas and me are thinking about simplify the override feature in annotation layer: instead of allow since or until or both, now we only allow override time_range as a whole.

in airbnb we don't have many cases where user want to override only since or until. if @fabianmenges feel this solution is not good enough, we can think about more possible solutions.

@fabianmenges @betodealmeida @mistercrunch @michellethomas

@codecov-io
Copy link

codecov-io commented Nov 7, 2018

Codecov Report

Merging #6286 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6286      +/-   ##
==========================================
+ Coverage   77.01%   77.03%   +0.01%     
==========================================
  Files          64       64              
  Lines        9508     9505       -3     
==========================================
- Hits         7323     7322       -1     
+ Misses       2185     2183       -2
Impacted Files Coverage Δ
superset/views/core.py 73.86% <ø> (+0.08%) ⬆️

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 cd05d44...6f277c4. Read the comment docs.

if (fd.time_range) {
[fd.since, fd.until] = fd.time_range.split(TIME_RANGE_SEPARATOR);
const overridesKeys = Object.keys(annotation.overrides);
if (overridesKeys.includes('since') || overridesKeys.includes('until')) {
Copy link
Author

Choose a reason for hiding this comment

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

this line is to backward compatible with old override options: since or until. now we only allow override whole time_range, so either since or until will be treated as override whole time_range.

@@ -97,6 +97,14 @@ export default class AnnotationLayer extends React.PureComponent {
timeColumn,
intervalEndColumn,
} = props;

const overridesKeys = Object.keys(overrides);
Copy link
Author

Choose a reason for hiding this comment

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

render checkbox UI. try to be backward compatible when user select override since or override until before.

@mistercrunch
Copy link
Member

@betodealmeida please 👀 ^

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

LGTM... thanks for fixing this, Grace!

@graceguo-supercat graceguo-supercat merged commit ede5c71 into apache:master Nov 8, 2018
@graceguo-supercat graceguo-supercat deleted the gg-OnlyAllowOverrideTimeRange branch November 8, 2018 03:26
graceguo-supercat pushed a commit to graceguo-supercat/superset that referenced this pull request Nov 8, 2018
(cherry picked from commit ede5c71)

(cherry picked from commit ad83b06)
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

4 participants