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: BigQuery cannot accept Time Grain #21489

Merged
merged 1 commit into from
Sep 16, 2022

Conversation

zhaoyongjie
Copy link
Member

SUMMARY

This PR fixes Time Grain in the BigQuery as datasource and FF GENERIC_CHART_AXES is enabled.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

After

image

Before

image

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

Comment on lines -200 to +203
if (isPhysicalColumn(xAxisValue) && Array.isArray(xAxis?.options)) {
for (let i = 0; i < xAxis.options.length; i += 1) {
if (xAxis.options[i].column_name === xAxisValue) {
return !!xAxis.options[i].is_dttm;
}
}
if (isPhysicalColumn(xAxisValue)) {
return !!(xAxis?.options ?? []).find(
(col: ColumnMeta) => col?.column_name === xAxisValue,
)?.is_dttm;
Copy link
Member Author

Choose a reason for hiding this comment

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

bycatch: improve code smell

Copy link
Member

Choose a reason for hiding this comment

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

Looks good, thanks!

@codecov
Copy link

codecov bot commented Sep 16, 2022

Codecov Report

Merging #21489 (f89ab10) into master (324e997) will increase coverage by 0.00%.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##           master   #21489   +/-   ##
=======================================
  Coverage   66.67%   66.68%           
=======================================
  Files        1791     1791           
  Lines       68478    68477    -1     
  Branches     7271     7271           
=======================================
  Hits        45661    45661           
+ Misses      20956    20955    -1     
  Partials     1861     1861           
Flag Coverage Δ
hive 53.08% <ø> (ø)
javascript 52.84% <0.00%> (+<0.01%) ⬆️
mysql 78.20% <ø> (ø)
postgres 78.27% <ø> (ø)
presto 52.98% <ø> (ø)
python 81.41% <ø> (ø)
sqlite 76.76% <ø> (ø)
unit 51.05% <ø> (ø)

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

Impacted Files Coverage Δ
...et-ui-chart-controls/src/shared-controls/index.tsx 59.61% <0.00%> (+1.12%) ⬆️
superset/connectors/sqla/models.py 90.60% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM, but curious to hear your thoughts on the proposed simplification.

superset/connectors/sqla/models.py Show resolved Hide resolved
@zhaoyongjie
Copy link
Member Author

LGTM, but curious to hear your thoughts on the proposed simplification.

Let me check where the whole codebase calls this argument.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

Approving to unblock the fix and deferring potential refactor to follow-up PR

@zhaoyongjie
Copy link
Member Author

I will refactor BaseEngineSpec.get_timestamp_expr in a separate PR.

@zhaoyongjie zhaoyongjie merged commit 33509ab into apache:master Sep 16, 2022
jinghua-qa pushed a commit to preset-io/superset that referenced this pull request Sep 19, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 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/S 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants