sqlmesh 0.199.1.dev39__py3-none-any.whl → 0.199.1.dev40__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sqlmesh/_version.py +2 -2
- sqlmesh/core/macros.py +1 -0
- sqlmesh/core/plan/evaluator.py +16 -3
- sqlmesh/core/plan/stages.py +4 -1
- sqlmesh/core/snapshot/evaluator.py +54 -23
- {sqlmesh-0.199.1.dev39.dist-info → sqlmesh-0.199.1.dev40.dist-info}/METADATA +1 -1
- {sqlmesh-0.199.1.dev39.dist-info → sqlmesh-0.199.1.dev40.dist-info}/RECORD +11 -11
- {sqlmesh-0.199.1.dev39.dist-info → sqlmesh-0.199.1.dev40.dist-info}/WHEEL +0 -0
- {sqlmesh-0.199.1.dev39.dist-info → sqlmesh-0.199.1.dev40.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.199.1.dev39.dist-info → sqlmesh-0.199.1.dev40.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.199.1.dev39.dist-info → sqlmesh-0.199.1.dev40.dist-info}/top_level.txt +0 -0
sqlmesh/_version.py
CHANGED
|
@@ -17,5 +17,5 @@ __version__: str
|
|
|
17
17
|
__version_tuple__: VERSION_TUPLE
|
|
18
18
|
version_tuple: VERSION_TUPLE
|
|
19
19
|
|
|
20
|
-
__version__ = version = '0.199.1.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 199, 1, '
|
|
20
|
+
__version__ = version = '0.199.1.dev40'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 199, 1, 'dev40')
|
sqlmesh/core/macros.py
CHANGED
sqlmesh/core/plan/evaluator.py
CHANGED
|
@@ -340,9 +340,11 @@ class BuiltInPlanEvaluator(PlanEvaluator):
|
|
|
340
340
|
)
|
|
341
341
|
if stage.demoted_environment_naming_info:
|
|
342
342
|
self._demote_snapshots(
|
|
343
|
-
stage.demoted_snapshots,
|
|
343
|
+
[stage.all_snapshots[s.snapshot_id] for s in stage.demoted_snapshots],
|
|
344
344
|
stage.demoted_environment_naming_info,
|
|
345
|
+
deployability_index=stage.deployability_index,
|
|
345
346
|
on_complete=lambda s: self.console.update_promotion_progress(s, False),
|
|
347
|
+
snapshots=stage.all_snapshots,
|
|
346
348
|
)
|
|
347
349
|
|
|
348
350
|
completed = True
|
|
@@ -382,12 +384,23 @@ class BuiltInPlanEvaluator(PlanEvaluator):
|
|
|
382
384
|
|
|
383
385
|
def _demote_snapshots(
|
|
384
386
|
self,
|
|
385
|
-
target_snapshots: t.Iterable[
|
|
387
|
+
target_snapshots: t.Iterable[Snapshot],
|
|
386
388
|
environment_naming_info: EnvironmentNamingInfo,
|
|
389
|
+
snapshots: t.Dict[SnapshotId, Snapshot],
|
|
390
|
+
deployability_index: t.Optional[DeployabilityIndex] = None,
|
|
387
391
|
on_complete: t.Optional[t.Callable[[SnapshotInfoLike], None]] = None,
|
|
388
392
|
) -> None:
|
|
389
393
|
self.snapshot_evaluator.demote(
|
|
390
|
-
target_snapshots,
|
|
394
|
+
target_snapshots,
|
|
395
|
+
environment_naming_info,
|
|
396
|
+
table_mapping=to_view_mapping(
|
|
397
|
+
snapshots.values(),
|
|
398
|
+
environment_naming_info,
|
|
399
|
+
default_catalog=self.default_catalog,
|
|
400
|
+
dialect=self.snapshot_evaluator.adapter.dialect,
|
|
401
|
+
),
|
|
402
|
+
deployability_index=deployability_index,
|
|
403
|
+
on_complete=on_complete,
|
|
391
404
|
)
|
|
392
405
|
|
|
393
406
|
def _restatement_intervals_across_all_environments(
|
sqlmesh/core/plan/stages.py
CHANGED
|
@@ -361,11 +361,14 @@ class PlanStagesBuilder:
|
|
|
361
361
|
# Otherwise, unpause right after updatig the environment record.
|
|
362
362
|
stages.append(UnpauseStage(promoted_snapshots=promoted_snapshots))
|
|
363
363
|
|
|
364
|
+
full_demoted_snapshots = self.state_reader.get_snapshots(
|
|
365
|
+
s.snapshot_id for s in demoted_snapshots if s.snapshot_id not in snapshots
|
|
366
|
+
)
|
|
364
367
|
virtual_layer_update_stage = self._get_virtual_layer_update_stage(
|
|
365
368
|
promoted_snapshots,
|
|
366
369
|
demoted_snapshots,
|
|
367
370
|
demoted_environment_naming_info,
|
|
368
|
-
snapshots,
|
|
371
|
+
snapshots | full_demoted_snapshots,
|
|
369
372
|
deployability_index,
|
|
370
373
|
)
|
|
371
374
|
if virtual_layer_update_stage:
|
|
@@ -276,8 +276,10 @@ class SnapshotEvaluator:
|
|
|
276
276
|
|
|
277
277
|
def demote(
|
|
278
278
|
self,
|
|
279
|
-
target_snapshots: t.Iterable[
|
|
279
|
+
target_snapshots: t.Iterable[Snapshot],
|
|
280
280
|
environment_naming_info: EnvironmentNamingInfo,
|
|
281
|
+
table_mapping: t.Optional[t.Dict[str, str]] = None,
|
|
282
|
+
deployability_index: t.Optional[DeployabilityIndex] = None,
|
|
281
283
|
on_complete: t.Optional[t.Callable[[SnapshotInfoLike], None]] = None,
|
|
282
284
|
) -> None:
|
|
283
285
|
"""Demotes the given collection of snapshots in the target environment by removing its view.
|
|
@@ -290,7 +292,13 @@ class SnapshotEvaluator:
|
|
|
290
292
|
with self.concurrent_context():
|
|
291
293
|
concurrent_apply_to_snapshots(
|
|
292
294
|
target_snapshots,
|
|
293
|
-
lambda s: self._demote_snapshot(
|
|
295
|
+
lambda s: self._demote_snapshot(
|
|
296
|
+
s,
|
|
297
|
+
environment_naming_info,
|
|
298
|
+
deployability_index=deployability_index,
|
|
299
|
+
on_complete=on_complete,
|
|
300
|
+
table_mapping=table_mapping,
|
|
301
|
+
),
|
|
294
302
|
self.ddl_concurrent_tasks,
|
|
295
303
|
)
|
|
296
304
|
|
|
@@ -970,25 +978,32 @@ class SnapshotEvaluator:
|
|
|
970
978
|
snapshots: t.Optional[t.Dict[SnapshotId, Snapshot]] = None,
|
|
971
979
|
table_mapping: t.Optional[t.Dict[str, str]] = None,
|
|
972
980
|
) -> None:
|
|
973
|
-
if snapshot.is_model:
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
981
|
+
if not snapshot.is_model:
|
|
982
|
+
return
|
|
983
|
+
|
|
984
|
+
adapter = (
|
|
985
|
+
self.get_adapter(snapshot.model_gateway)
|
|
986
|
+
if environment_naming_info.gateway_managed
|
|
987
|
+
else self.adapter
|
|
988
|
+
)
|
|
989
|
+
table_name = snapshot.table_name(deployability_index.is_representative(snapshot))
|
|
990
|
+
view_name = snapshot.qualified_view_name.for_environment(
|
|
991
|
+
environment_naming_info, dialect=adapter.dialect
|
|
992
|
+
)
|
|
993
|
+
render_kwargs: t.Dict[str, t.Any] = dict(
|
|
994
|
+
start=start,
|
|
995
|
+
end=end,
|
|
996
|
+
execution_time=execution_time,
|
|
997
|
+
engine_adapter=adapter,
|
|
998
|
+
deployability_index=deployability_index,
|
|
999
|
+
table_mapping=table_mapping,
|
|
1000
|
+
runtime_stage=RuntimeStage.PROMOTING,
|
|
1001
|
+
)
|
|
1002
|
+
|
|
1003
|
+
with (
|
|
1004
|
+
adapter.transaction(),
|
|
1005
|
+
adapter.session(snapshot.model.render_session_properties(**render_kwargs)),
|
|
1006
|
+
):
|
|
992
1007
|
_evaluation_strategy(snapshot, adapter).promote(
|
|
993
1008
|
table_name=table_name,
|
|
994
1009
|
view_name=view_name,
|
|
@@ -1007,10 +1022,15 @@ class SnapshotEvaluator:
|
|
|
1007
1022
|
|
|
1008
1023
|
def _demote_snapshot(
|
|
1009
1024
|
self,
|
|
1010
|
-
snapshot:
|
|
1025
|
+
snapshot: Snapshot,
|
|
1011
1026
|
environment_naming_info: EnvironmentNamingInfo,
|
|
1027
|
+
deployability_index: t.Optional[DeployabilityIndex],
|
|
1012
1028
|
on_complete: t.Optional[t.Callable[[SnapshotInfoLike], None]],
|
|
1029
|
+
table_mapping: t.Optional[t.Dict[str, str]] = None,
|
|
1013
1030
|
) -> None:
|
|
1031
|
+
if not snapshot.is_model:
|
|
1032
|
+
return
|
|
1033
|
+
|
|
1014
1034
|
adapter = (
|
|
1015
1035
|
self.get_adapter(snapshot.model_gateway)
|
|
1016
1036
|
if environment_naming_info.gateway_managed
|
|
@@ -1019,7 +1039,18 @@ class SnapshotEvaluator:
|
|
|
1019
1039
|
view_name = snapshot.qualified_view_name.for_environment(
|
|
1020
1040
|
environment_naming_info, dialect=adapter.dialect
|
|
1021
1041
|
)
|
|
1022
|
-
|
|
1042
|
+
with (
|
|
1043
|
+
adapter.transaction(),
|
|
1044
|
+
adapter.session(
|
|
1045
|
+
snapshot.model.render_session_properties(
|
|
1046
|
+
engine_adapter=adapter,
|
|
1047
|
+
deployability_index=deployability_index,
|
|
1048
|
+
table_mapping=table_mapping,
|
|
1049
|
+
runtime_stage=RuntimeStage.DEMOTING,
|
|
1050
|
+
)
|
|
1051
|
+
),
|
|
1052
|
+
):
|
|
1053
|
+
_evaluation_strategy(snapshot, adapter).demote(view_name)
|
|
1023
1054
|
|
|
1024
1055
|
if on_complete is not None:
|
|
1025
1056
|
on_complete(snapshot)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
sqlmesh/__init__.py,sha256=QjwaamJIdW7voXoS880yAx7tHm-Im4_mqGA-XJgafos,7631
|
|
2
|
-
sqlmesh/_version.py,sha256=
|
|
2
|
+
sqlmesh/_version.py,sha256=EE7cTtgWDjjKm6quUTsyqT6v7wY9dy5o0fW0WNmaVM4,530
|
|
3
3
|
sqlmesh/magics.py,sha256=bEzYqXHcM0P3CjyUZ1O9arlmXAdLAhoglKbQ29fD9AE,41842
|
|
4
4
|
sqlmesh/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
sqlmesh/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -19,7 +19,7 @@ sqlmesh/core/dialect.py,sha256=1ykYwb9WZn_nCaX08PcQ0BJh2Pihv9SPvoMNjpMeCfs,50158
|
|
|
19
19
|
sqlmesh/core/environment.py,sha256=7DbJX0r5nZRU3LhcgIxbSV-JosQYDjAt3V5Wc2Fpns8,13005
|
|
20
20
|
sqlmesh/core/lineage.py,sha256=zjB0Zfamo2Fja2r5SSZPMbrEKTXr1WjozZPVqvxdybI,3143
|
|
21
21
|
sqlmesh/core/loader.py,sha256=Imb65SX5TtvQrtlilin2hkYg12gm9e9c30I8o95nkVE,40534
|
|
22
|
-
sqlmesh/core/macros.py,sha256=
|
|
22
|
+
sqlmesh/core/macros.py,sha256=3M3lChT2X5APuHyEprEbFfCXL31ab_2k3KkgPLKx6xE,60652
|
|
23
23
|
sqlmesh/core/node.py,sha256=3ChBz1PIMJhp-jzed_GLBrtmEF2v_BVDEM5WNe0ssPk,14658
|
|
24
24
|
sqlmesh/core/notification_target.py,sha256=PPGoDrgbRKxr27vJEu03XqNTQLYTw0ZF_b0yAapxGeI,16158
|
|
25
25
|
sqlmesh/core/reference.py,sha256=k7OSkLqTjPR8WJjNeFj0xAJ297nZUMgb_iTVwKRRKjc,4875
|
|
@@ -96,14 +96,14 @@ sqlmesh/core/model/seed.py,sha256=a0M-1zY1gOkN5ph2GQyataEdBSCtq50YjeFk2LyvInI,50
|
|
|
96
96
|
sqlmesh/core/plan/__init__.py,sha256=NKSvM7ZBVjw9ho3J65M1wFvG3KURB8PJ0FHHLmtSF44,443
|
|
97
97
|
sqlmesh/core/plan/builder.py,sha256=TQVSGiGbQi9tro0tBlcL2f5BEvyOYNiLuB3yz8PRUzA,41859
|
|
98
98
|
sqlmesh/core/plan/definition.py,sha256=yrX_uZMXi29ltkuowWhNUOi1kd0Uq0TQoM574EI6JHo,14019
|
|
99
|
-
sqlmesh/core/plan/evaluator.py,sha256=
|
|
99
|
+
sqlmesh/core/plan/evaluator.py,sha256=OS6ayFwb_o1CBccVfiWPse8ecpI4nCcV8Ubr9yEp7yE,21527
|
|
100
100
|
sqlmesh/core/plan/explainer.py,sha256=aBkvtM9eog_2NIglazSDdG_i9TTCdFSVOkCw5N8O-1k,12028
|
|
101
|
-
sqlmesh/core/plan/stages.py,sha256=
|
|
101
|
+
sqlmesh/core/plan/stages.py,sha256=JN7rwo6ibY5Ctqof3Us7Eu2x85n5GXH0rCA47BBvP1o,22228
|
|
102
102
|
sqlmesh/core/snapshot/__init__.py,sha256=Z5HTetNCZGoKF1WAKXk4LWL9dc8EC8lwS2O4TtoBmt4,1317
|
|
103
103
|
sqlmesh/core/snapshot/cache.py,sha256=bgqCR2hyf6r2A_8QP1EnXFK25gDX37-Zg0YeMuETWxg,3934
|
|
104
104
|
sqlmesh/core/snapshot/categorizer.py,sha256=qGG5870mu1jR2whKisSBH_GFbsyh96RnzJDgkN7DV9g,2482
|
|
105
105
|
sqlmesh/core/snapshot/definition.py,sha256=DwYTNcDfPQUQ1osF_63SdicSj7oqVjtmPPEzqwsxDLU,85748
|
|
106
|
-
sqlmesh/core/snapshot/evaluator.py,sha256=
|
|
106
|
+
sqlmesh/core/snapshot/evaluator.py,sha256=CPjpzUmFwjM9wTECe6KJB5FaY2C7LwxvFT9fXSorfTs,91489
|
|
107
107
|
sqlmesh/core/state_sync/__init__.py,sha256=B60xj-_Xk-4jas3UphLvwkuf04G-9AyGckcblXE0aRg,869
|
|
108
108
|
sqlmesh/core/state_sync/base.py,sha256=AdqWmbhnvRFqVcFK6L01uCvpBVAYGuMrm4P0D3u_NaU,18334
|
|
109
109
|
sqlmesh/core/state_sync/cache.py,sha256=0AsYdQyBqbLdJvkBQ-hDAipsvnn_jSps-nya-Q4XeL0,5337
|
|
@@ -282,7 +282,7 @@ sqlmesh/utils/pydantic.py,sha256=o_NsXbIpDqNpUA1Uc5xF0ZzoXQYYB0DfHwdRxBwXPNk,120
|
|
|
282
282
|
sqlmesh/utils/rich.py,sha256=BpB47G0-JcU41LkGkeGKroexj4NOV5fox4-GOIXPgIc,3545
|
|
283
283
|
sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
|
|
284
284
|
sqlmesh/utils/yaml.py,sha256=hvo5lmybYLcIx4p6CQwufS8X4MbwS60lEBnCmYJCXmU,2336
|
|
285
|
-
sqlmesh-0.199.1.
|
|
285
|
+
sqlmesh-0.199.1.dev40.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
|
|
286
286
|
web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
287
287
|
web/client/dist/index.html,sha256=DAv6ABGogw4xRLb0T_92WP_S7XWyqVhwBgGKWtuQwU4,5472
|
|
288
288
|
web/client/dist/assets/Audits-BuHAmFO8.js,sha256=zbYUF6WdUGMbnMm01GMNPb7xAJwj-o5wMdL56vPo2qE,1041
|
|
@@ -400,8 +400,8 @@ web/server/api/endpoints/models.py,sha256=kwj0s7uve3iZSMfmjkoPVMFMeY1sD0peTeyrWf
|
|
|
400
400
|
web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
|
|
401
401
|
web/server/api/endpoints/plan.py,sha256=bbbY50W_2MsZSTxOHWMKz0tbIm75nsRSlPy8GI2fg9Q,9306
|
|
402
402
|
web/server/api/endpoints/table_diff.py,sha256=SCy3-pr5x6bEEiOaZGCDbiHQhpgxwmnz3Acqa2Ie6jI,2090
|
|
403
|
-
sqlmesh-0.199.1.
|
|
404
|
-
sqlmesh-0.199.1.
|
|
405
|
-
sqlmesh-0.199.1.
|
|
406
|
-
sqlmesh-0.199.1.
|
|
407
|
-
sqlmesh-0.199.1.
|
|
403
|
+
sqlmesh-0.199.1.dev40.dist-info/METADATA,sha256=S-TqhhNsoX0A4IVs75-nl19m-ot2LifHN164Yvthk9o,26659
|
|
404
|
+
sqlmesh-0.199.1.dev40.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
405
|
+
sqlmesh-0.199.1.dev40.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
406
|
+
sqlmesh-0.199.1.dev40.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
407
|
+
sqlmesh-0.199.1.dev40.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|