Repository navigation
fix: Ensure that representative but not deployable snapshots use the Prod physical models consistently - #6065
Conversation
…any intervals and are a pure pass-through of prod. Signed-off-by: davem-bis <68955845+davem-bis@users.noreply.github.com>
…ted. Signed-off-by: davem-bis <68955845+davem-bis@users.noreply.github.com>
| if not s.is_model or s.is_symbolic: | ||
| return False | ||
|
|
||
| # Do not create snapshots that contain production data but can never be deployed. |
There was a problem hiding this comment.
This needs an appropriate unit test.
|
@davem-bis -- Took a peak at this: looks like you're making the change a level down, so it affects plan as well. That would explain your comment about why in "dev_only" mode you're getting empty tables (probably because of the So we're seeing another bug that creates and backfills a My recommendation:
I think its your changes to |
…non-breaking-always-uses-prod-ledger
…o the missing interval check. Signed-off-by: davem-bis <68955845+davem-bis@users.noreply.github.com>
Signed-off-by: davem-bis <68955845+davem-bis@users.noreply.github.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Tip 🎯 Customize your risk assessments
✅ Automatic approvals, with your rules
CodeRabbit Verify
|
|
Hi @cmgoffena13 - sorry for the massive delay but I'm picking this up again. I'm still hitting a sticking point when VDE mode is
Option 2. is easiest to implement, Option 1. 1 would break if it ever tried to clone something that wasn't a table, but I believe that this scenario can only occur for tables (as opposed to a view or ephemeral) so that shouldn't be an issue. I'm going to implement option 2 as it matches existing behaviour, but please shout if you think there's something I've missed. |
…ly VDE mode. Signed-off-by: davem-bis <68955845+davem-bis@users.noreply.github.com>
…king changes. Signed-off-by: davem-bis <68955845+davem-bis@users.noreply.github.com>
Description
Fixes #5793.
Ensures that all snapshots that are representative but not deployable (they contain the same data as prod, but can never become prod) are just pass through views of the production physical table. A by-product of this is that they can never have any missing intervals.
Test Plan
INDIRECT_BREAKING_CHANGESsnapshots to prove idempotence.sqlmesh initsqlmesh planAdd
'ABC' AS extra_columntoincremental_model.sqlsqlmesh plan indirect_non_breakingsqlmesh runsqlmesh run indirect_non_breakingsqlmesh fetchdf "UPDATE sqlmesh._intervals SET end_ts = end_ts - 86400000, start_ts = start_ts - 86400000, last_altered_ts = last_altered_ts - 86400000"sqlmesh run indirect_non_breakingsqlmesh run indirect_non_breakingPlan a new model named
extra_modelas aSELECT * FROM sqlmesh_example.full_modeland confirm that it is selecting from thefull_modelphysical model without the__devextension.indirect_non_breakingseed_modelincremental_modelfull_modelfull_modeluses the non-__devphysical model, and has no missing intervals.vde_mode: dev_only.Checklist
make styleand fixed any issuesmake fast-test)git commit -s) per the DCO