Skip to content

Conversation

@KSDaemon
Copy link
Member

@KSDaemon KSDaemon commented Apr 16, 2025

This PR makes RefreshKey SQL generation to use the query timezone. This is important for the case when there are a few scheduled refresh timezones (or even one but different from UTC) and there is a pre-aggregation with day partition granularity. So you want them to be updated at midnight in the provided timezone rather than at UTC.
This fixes it.

The change is also made in cron-based refresh keys, making them timezone-aware. If the pre-aggregation refresh_key does not define a timezone, then the timezone of the query will be used.

Check List

  • Tests have been run in packages where changes made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

@codecov
Copy link

codecov bot commented Apr 16, 2025

Codecov Report

Attention: Patch coverage is 35.71429% with 9 lines in your changes missing coverage. Please review.

Project coverage is 58.47%. Comparing base (e033d89) to head (792a1ad).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...rchestrator/src/orchestrator/BaseQueueEventsBus.ts 0.00% 2 Missing ⚠️
...orchestrator/src/orchestrator/QueryOrchestrator.ts 0.00% 2 Missing ⚠️
...ges/cubejs-server-core/src/core/OrchestratorApi.ts 33.33% 2 Missing ⚠️
...y-orchestrator/src/orchestrator/PreAggregations.ts 0.00% 1 Missing ⚠️
...-query-orchestrator/src/orchestrator/QueryCache.ts 50.00% 0 Missing and 1 partial ⚠️
...es/cubejs-schema-compiler/src/adapter/BaseQuery.js 75.00% 0 Missing and 1 partial ⚠️

❗ There is a different number of reports uploaded between BASE (e033d89) and HEAD (792a1ad). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (e033d89) HEAD (792a1ad)
cubesql 1 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #9479       +/-   ##
===========================================
- Coverage   83.88%   58.47%   -25.41%     
===========================================
  Files         229      167       -62     
  Lines       83544    14928    -68616     
  Branches        0     2955     +2955     
===========================================
- Hits        70079     8729    -61350     
+ Misses      13465     5853     -7612     
- Partials        0      346      +346     
Flag Coverage Δ
cube-backend 58.47% <35.71%> (?)
cubesql ?

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@KSDaemon KSDaemon marked this pull request as ready for review April 16, 2025 15:06
@KSDaemon KSDaemon requested review from a team as code owners April 16, 2025 15:06
Copy link
Member

@ovr ovr left a comment

Choose a reason for hiding this comment

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

LGTM

@KSDaemon KSDaemon merged commit fa2adb9 into master Apr 17, 2025
68 checks passed
@KSDaemon KSDaemon deleted the fix/pre-aggs branch April 17, 2025 14:24
marianore-muttdata pushed a commit to MuttData/cube that referenced this pull request Jun 17, 2025
* code polish

* a bit of types

* code polish

* grammar fix

* code polish

* fix(schema-compiler): Make RefreshKeySql timezone-aware

* update moment-timezone

* fix docs

* fix tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants