fix(bronze-freshness): correct openai epoch anchor + align wiki ms-parse - #2
Closed
dzarlax wants to merge 1 commit into
Closed
Conversation
Review of constructorfabric#1346 caught two anchor issues in the per-source freshness blocks: - openai: `bucket_start_time` is Unix seconds (integer), per the connector's own dbt models (toDate(fromUnixTimestamp(CAST(bucket_start_time AS UInt32)))). parseDateTimeBestEffortOrNull expects a string and would runtime-error on all usage/cost tables. Switch to fromUnixTimestamp(CAST(... AS UInt32)). - confluence/outline wiki_pages: align to parseDateTime64BestEffortOrNull(updated_at, 3) to match each connector's own model convention (functionally equivalent for freshness, but consistent). Follow-up to PR constructorfabric#1 on this branch; keeps constructorfabric#1346 correct before it merges to main.
dzarlax
force-pushed
the
fix/freshness-openai-epoch-anchor
branch
from
June 16, 2026 16:24
d450676 to
cb13e9c
Compare
Owner
|
Folded into claude/dbt-test-coverage as ab03586 — cherry-picked with your authorship kept, signed off for DCO. Re-checked each anchor against the connectors' own models before pushing:
Closing since it's on the branch. Good catch on the openai one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Follow-up to #1 on this branch — fixes two
loaded_at_fieldanchors found while reviewing the merged freshness declarations before constructorfabric#1346 lands.bucket_start_timeis Unix seconds (an integer), per the connector's own dbt models (to_ai_cost.sql/to_ai_tool_usage.sql:toDate(fromUnixTimestamp(CAST(bucket_start_time AS UInt32)))). The anchor wasparseDateTimeBestEffortOrNull(bucket_start_time), which expects a string and wouldruntime erroron all 9 usage tables + costs once OpenAI is ingested. Switched tofromUnixTimestamp(CAST(bucket_start_time AS UInt32)).wiki_pagesnow usesparseDateTime64BestEffortOrNull(updated_at, 3)to match each connector's own model convention. Functionally equivalent for freshness, but consistent.Why before merge
openai is empty in the dogfood install, so the runtime error wouldn't surface until OpenAI is ingested — but it's a latent false-positive (page on every run) waiting to happen. Cheaper to fix now than to debug a red gate later.
No other anchors are affected: the remaining inferred columns (
day,date,metric_date,snapshot_date, event times) were each cross-checked against the connector's own silver model and parse correctly.