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(annotations): time grain column #26140

Merged
merged 3 commits into from
Nov 30, 2023
Merged

fix(annotations): time grain column #26140

merged 3 commits into from
Nov 30, 2023

Conversation

betodealmeida
Copy link
Member

SUMMARY

A confusing bug in the annotation layers... it seems that in the form data the granularity attribute stores the time grain (eg, P1D for daily time grain):

granularity: {
type: 'SelectControl',
freeForm: true,
label: TIME_FILTER_LABELS.granularity,
default: 'P1D',
choices: [
[null, t('all')],
['PT5S', t('5 seconds')],
['PT30S', t('30 seconds')],
['PT1M', t('1 minute')],
['PT5M', t('5 minutes')],
['PT30M', t('30 minutes')],
['PT1H', t('1 hour')],
['PT6H', t('6 hour')],
['P1D', t('1 day')],
['P7D', t('7 days')],
['P1W', t('week')],
['week_starting_sunday', t('week starting Sunday')],
['week_ending_saturday', t('week ending Saturday')],
['P1M', t('month')],
['P3M', t('quarter')],
['P1Y', t('year')],
],

But in the request payload, granularity should point to the column name, not the grain:

granularity = fields.String(
metadata={"description": "Name of temporal column used for time filtering. "},
allow_none=True,
)

When generating an annotation query we need to move things around to match the form data to the request schema.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Copy link

codecov bot commented Nov 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c7f8d11) 69.01% compared to head (342bc26) 69.05%.
Report is 139 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #26140      +/-   ##
==========================================
+ Coverage   69.01%   69.05%   +0.03%     
==========================================
  Files        1934     1934              
  Lines       75605    75604       -1     
  Branches     8414     8414              
==========================================
+ Hits        52181    52208      +27     
+ Misses      21264    21236      -28     
  Partials     2160     2160              
Flag Coverage Δ
hive 53.67% <ø> (ø)
javascript 56.24% <100.00%> (+0.07%) ⬆️
mysql 78.35% <ø> (ø)
postgres 78.45% <ø> (ø)
presto 53.63% <ø> (ø)
python 82.91% <ø> (ø)
sqlite 77.10% <ø> (ø)
unit 55.50% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@betodealmeida betodealmeida merged commit cff473f into master Nov 30, 2023
51 checks passed
@michael-s-molina michael-s-molina added v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch labels Dec 1, 2023
michael-s-molina pushed a commit that referenced this pull request Dec 4, 2023
michael-s-molina pushed a commit that referenced this pull request Dec 4, 2023
josedev-union pushed a commit to Ortege-xyz/studio that referenced this pull request Jan 22, 2024
@mistercrunch mistercrunch added 🍒 3.0.3 🍒 3.0.4 🍒 3.1.0 🍒 3.1.1 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Mar 8, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
@mistercrunch mistercrunch deleted the sc-69810 branch March 26, 2024 18:06
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 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 v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch v3.1 Label added by the release manager to track PRs to be included in the 3.1 branch 🍒 3.0.3 🍒 3.0.4 🍒 3.1.0 🍒 3.1.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants