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 |
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