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(viz): BigQuery time grain 'minute'/'second' throws an error #20350

Conversation

diegomedina248
Copy link
Contributor

SUMMARY

The time grain for minute and second is throwing an error.
For BigQuery, the DATE_TRUNC function does not support MINUTE and SECOND as param.
This PR changes the calculation to support these time grain options.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Error:
Screen Shot 2022-06-10 at 18 31 29

TESTING INSTRUCTIONS

  1. Create a Time-series table
  2. Mark a DATE column as temporal
  3. Select that column as the time column
  4. Set the time grain to Minute or Second

Ensure the query executes as expected.

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

@codecov
Copy link

codecov bot commented Jun 10, 2022

Codecov Report

Merging #20350 (2c2c447) into master (c842c9e) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master   #20350   +/-   ##
=======================================
  Coverage   66.67%   66.67%           
=======================================
  Files        1738     1738           
  Lines       65071    65071           
  Branches     6884     6884           
=======================================
  Hits        43387    43387           
  Misses      19937    19937           
  Partials     1747     1747           
Flag Coverage Δ
hive 53.71% <ø> (ø)
mysql 82.29% <ø> (ø)
postgres 82.36% <ø> (ø)
presto 53.57% <ø> (ø)
python 82.78% <ø> (ø)
sqlite 82.09% <ø> (ø)
unit 50.16% <ø> (ø)

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

Impacted Files Coverage Δ
superset/db_engine_specs/bigquery.py 84.84% <ø> (ø)
superset/datasets/api.py 88.52% <0.00%> (ø)

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 c842c9e...2c2c447. Read the comment docs.

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

LGTM

@michael-s-molina michael-s-molina merged commit 5afeba3 into apache:master Jun 21, 2022
michael-s-molina pushed a commit that referenced this pull request Jun 23, 2022
michael-s-molina pushed a commit that referenced this pull request Jun 28, 2022
@mistercrunch mistercrunch added 🍒 2.0.0 🍒 2.0.1 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 labels Mar 13, 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/XS v2.0 🍒 2.0.0 🍒 2.0.1 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants