Repository navigation
Conversation
Vertica had no override, so it fell back to dbt's default__current_timestamp_in_utc_backcompat, which is just the session-local current_timestamp. With the CI container on America/Los_Angeles, the "UTC" timestamp lagged real UTC by 7 hours, so between 00:00 and 07:00 UTC freshness SLA deadlines looked unpassed and metric stability baselines looked unsettled, and tests that should fail passed. Use current_timestamp at time zone 'UTC' instead, and note in the compose file that the non-UTC TZ is intentional. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
👋 @joostboon |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
Reproduced this and verified the fix on a real setup, in case it helps the review. Setup: Vertica 24.1.0 (CE container, server time zone Before (0.26.1): After: cherry-picked 7290b0c on top of 0.26.1 - the difference to Tests: full One note: the suite also passes without the fix on a non-UTC server (267 passed, the 1 failure was unrelated), so nothing in it currently catches this bug. Would be great to get this into the next release. |
Problem
The Vertica CI job fails 12 tests whenever it runs between roughly 00:00 and 07:00 UTC, all with
'pass' == 'fail':test_data_freshness_sla.py:test_no_data_fails,test_stale_data_fails,test_with_where_expressiontest_metric_stability.py:detects_restated_settled_value,detects_restatement_in_any_column,first_check_catches_gradual_drift,quoted_column_details[first_check|last_check],reports_disappearing_bucket[dimensions0|1],reports_disappearing_dimension,tolerates_change_within_thresholdRoot cause
There was no
vertica__edr_current_timestamp_in_utc, so the default implementation used dbt'sdefault__current_timestamp_in_utc_backcompat, which is simplycurrent_timestamp::timestampin the session's local time zone. The CI container runs withTZ=America/Los_Angeles, so the "UTC" timestamp lagged real UTC by 7 hours. During early UTC hours that meant:current_timestamp_in_utc > sla_deadline_utcwas still false, so stale or missing data was not flagged;updated_atearlier than the bucket's settle time, so they were never used as a baseline and restatements went undetected.Fix
Add
vertica__edr_current_timestamp_in_utcreturningcast(current_timestamp at time zone 'UTC' as timestamp). This also fixes the same skew for real Vertica deployments whose server is not set to UTC.The container
TZis left as is and now has a comment explaining it is intentionally non-UTC, since that is what surfaced this bug.Verification
Ran locally against
ghcr.io/ratiopbc/vertica-cewith the container clock skewed:Etc/GMT+12(UTC-12, local date one day behind)Etc/GMT+12Etc/GMT-14(UTC+14)🤖 Generated with Claude Code
Summary by CodeRabbit