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] Chart specific time controls #8674

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented Nov 27, 2019

CATEGORY

Choose one

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

SUMMARY

This PR ensures that only the relevant time widgets are included depending on the chart type. Previously the granularity logic was shown even if the chart type did not support granularity, i.e., non-timeseries charts.

This provides a number of benefits including:

  1. Improved UX: It's not apparent to the user that these controls have no impact on the chart.
  2. Improved performance: The controls serve as inputs to the cache and thus the cache is invalidated when these erroneous options are changed.
  3. Cleaner form-data: The impetus for this change stemmed from a project migrating charts from Druid NoSQL to SQL where there isn't a 1:1 mapping for the time parameters. The erroneous values could deem a chart is non-migratable even though in theory is was.

Additionally this PR also removes the time controls for chart types which don't support time filtering, i.e., iFrame, Markup, etc.

Note erroneous form-data fields are removed on load in explorer but will persist in database until the slice is re-saved.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before

Screen Shot 2019-11-26 at 6 26 46 PM

After

Screen Shot 2019-11-26 at 6 24 49 PM

TEST PLAN

CI.

ADDITIONAL INFORMATION

REVIEWERS

to: @etr2460 @graceguo-supercat @michellethomas @mistercrunch @willbarrett @villebro

@john-bodley john-bodley changed the title [charts] Chart specific time controls [fix] Chart specific time controls Nov 27, 2019
@john-bodley john-bodley force-pushed the john-bodley--chart-specific-time-grainularity branch from 79f3b6d to 1a9d6a8 Compare December 3, 2019 01:37
@codecov-io
Copy link

codecov-io commented Dec 3, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8674      +/-   ##
==========================================
+ Coverage    65.4%   65.54%   +0.14%     
==========================================
  Files         482      482              
  Lines       24083    24083              
  Branches     2763     2763              
==========================================
+ Hits        15751    15786      +35     
+ Misses       8152     8117      -35     
  Partials      180      180
Impacted Files Coverage Δ
...rset/assets/src/explore/controlPanels/sections.jsx 100% <ø> (ø) ⬆️
superset/assets/src/explore/controls.jsx 40.14% <0%> (-1.46%) ⬇️
superset/views/core.py 71.82% <0%> (+0.2%) ⬆️
superset/models/core.py 83.21% <0%> (+0.57%) ⬆️
superset/dataframe.py 94.48% <0%> (+1.57%) ⬆️
superset/db_engine_specs/mysql.py 92.59% <0%> (+51.85%) ⬆️

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 871af05...1a9d6a8. Read the comment docs.

@pull-request-size pull-request-size bot added size/M and removed size/L labels Dec 3, 2019
@@ -23,7 +23,7 @@ export const druidTimeSeries = {
label: t('Time'),
expanded: true,
description: t('Time related form attributes'),
controlSetRows: [['granularity', 'druid_time_origin'], ['time_range']],
controlSetRows: [['time_range']],
Copy link
Member

Choose a reason for hiding this comment

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

why did you remove both of these here but only one in sqla?

Copy link
Member

Choose a reason for hiding this comment

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

synced offline, this is good

Copy link
Member

@etr2460 etr2460 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 cleaning these unused controls!

@@ -23,7 +23,7 @@ export const druidTimeSeries = {
label: t('Time'),
expanded: true,
description: t('Time related form attributes'),
controlSetRows: [['granularity', 'druid_time_origin'], ['time_range']],
controlSetRows: [['time_range']],
Copy link
Member

Choose a reason for hiding this comment

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

synced offline, this is good

@john-bodley john-bodley merged commit 38782e2 into apache:master Dec 4, 2019
john-bodley added a commit to airbnb/superset-fork that referenced this pull request Dec 4, 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/M 🚢 0.36.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[explore] disable "granularity" control for non-timeseries visualizations
4 participants