Repository navigation
Add insert-only history tables for gold signal snapshots - #2
Open
Mitchell-MC wants to merge 1 commit into
Open
Mitchell-MC wants to merge 1 commit into
Mitchell-MC wants to merge 1 commit into
Conversation
gold.cart_recovery_signal and gold.fulfillment_risk_signal are overwritten each run for DirectQuery ops consumers, so they can't answer historical questions and gold_exec_summary_marts.py had to depend on run-timing to capture a snapshot before it was overwritten. Each gold job now also appends to a *_history table (periodic snapshot fact, insert-only), and exec_summary_marts reads the latest run from history instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
3 of 4 tasks
This branch has not been deployed
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.
Summary
gold.cart_recovery_signal/gold.fulfillment_risk_signalare overwrite-mode current-snapshot tables (needed for DirectQuery ops consumers perbi/powerbi/data-model.md), so they can't answer historical questions.gold_exec_summary_marts.pypreviously depended on being scheduled after (but not too long after) the hourly/4h signal jobs to capture a snapshot before it was overwritten — a real timing coupling, called out in its own docstring.*_historytable (periodic snapshot fact, keyed by_snapshot_at), andgold_exec_summary_marts.pyreads the latest run from history instead of the live snapshot table — removing the timing dependency.Test plan
ruff check/black --checkpass against CI's pinned versions (ruff==0.15.22,black==25.11.0)tests/unit/test_gold_exec_summary_marts.pycovering the latest-snapshot selection logic; verified the selection logic directly (Spark-free) since this Windows dev environment can't run local PySpark (pre-existing limitation — the untouchedtest_gold_cart_recovery.pyfails the same way here)pytest tests/unit --cov=srcpasses in CI (Ubuntu) on this PR🤖 Generated with Claude Code