sqlmesh 0.186.1.dev2__py3-none-any.whl → 0.186.1.dev4__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/plan/builder.py +9 -9
- sqlmesh/core/plan/evaluator.py +23 -2
- {sqlmesh-0.186.1.dev2.dist-info → sqlmesh-0.186.1.dev4.dist-info}/METADATA +1 -1
- {sqlmesh-0.186.1.dev2.dist-info → sqlmesh-0.186.1.dev4.dist-info}/RECORD +9 -9
- {sqlmesh-0.186.1.dev2.dist-info → sqlmesh-0.186.1.dev4.dist-info}/WHEEL +0 -0
- {sqlmesh-0.186.1.dev2.dist-info → sqlmesh-0.186.1.dev4.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.186.1.dev2.dist-info → sqlmesh-0.186.1.dev4.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.186.1.dev2.dist-info → sqlmesh-0.186.1.dev4.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.186.1.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 186, 1, '
|
|
20
|
+
__version__ = version = '0.186.1.dev4'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 186, 1, 'dev4')
|
sqlmesh/core/plan/builder.py
CHANGED
|
@@ -344,6 +344,15 @@ class PlanBuilder:
|
|
|
344
344
|
for s_id in dag:
|
|
345
345
|
snapshot = self._context_diff.snapshots[s_id]
|
|
346
346
|
|
|
347
|
+
# Since we are traversing the graph in topological order and the largest interval range is pushed down
|
|
348
|
+
# the graph we just have to check our immediate parents in the graph and not the whole upstream graph.
|
|
349
|
+
restating_parents = [
|
|
350
|
+
self._context_diff.snapshots[s] for s in snapshot.parents if s in restatements
|
|
351
|
+
]
|
|
352
|
+
|
|
353
|
+
if not restating_parents and snapshot.name not in restate_models:
|
|
354
|
+
continue
|
|
355
|
+
|
|
347
356
|
if not forward_only_preview_needed:
|
|
348
357
|
if self._is_dev and not snapshot.is_paused:
|
|
349
358
|
self._console.log_warning(
|
|
@@ -362,15 +371,6 @@ class PlanBuilder:
|
|
|
362
371
|
logger.info("Skipping restatement for model '%s'", snapshot.name)
|
|
363
372
|
continue
|
|
364
373
|
|
|
365
|
-
# Since we are traversing the graph in topological order and the largest interval range is pushed down
|
|
366
|
-
# the graph we just have to check our immediate parents in the graph and not the whole upstream graph.
|
|
367
|
-
restating_parents = [
|
|
368
|
-
self._context_diff.snapshots[s] for s in snapshot.parents if s in restatements
|
|
369
|
-
]
|
|
370
|
-
|
|
371
|
-
if not restating_parents and snapshot.name not in restate_models:
|
|
372
|
-
continue
|
|
373
|
-
|
|
374
374
|
possible_intervals = {
|
|
375
375
|
restatements[p.snapshot_id] for p in restating_parents if p.is_incremental
|
|
376
376
|
}
|
sqlmesh/core/plan/evaluator.py
CHANGED
|
@@ -116,6 +116,7 @@ class BuiltInPlanEvaluator(PlanEvaluator):
|
|
|
116
116
|
after_promote_snapshots = all_names - before_promote_snapshots
|
|
117
117
|
deployability_index_for_evaluation = DeployabilityIndex.all_deployable()
|
|
118
118
|
|
|
119
|
+
# Step 1: Run before_all environment statements before doing anything else
|
|
119
120
|
execute_environment_statements(
|
|
120
121
|
adapter=self.snapshot_evaluator.adapter,
|
|
121
122
|
environment_statements=plan.environment_statements or [],
|
|
@@ -128,15 +129,24 @@ class BuiltInPlanEvaluator(PlanEvaluator):
|
|
|
128
129
|
execution_time=plan.execution_time,
|
|
129
130
|
)
|
|
130
131
|
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
# Step 2:Store new snapshot records in the state and create physical tables for them
|
|
133
133
|
push_completion_status = self._push(plan, snapshots, deployability_index_for_creation)
|
|
134
134
|
if push_completion_status.is_nothing_to_do:
|
|
135
135
|
self.console.log_success(
|
|
136
136
|
"" if plan.restatements else "\nSKIP: No physical layer updates to perform"
|
|
137
137
|
)
|
|
138
|
+
|
|
139
|
+
# Step 3: Update the intervals for the new forward-only snapshots
|
|
138
140
|
update_intervals_for_new_snapshots(plan.new_snapshots, self.state_sync)
|
|
141
|
+
|
|
142
|
+
# Step 4: Run audits without evaluations for snapshots that capture audit metadata changes
|
|
143
|
+
self._run_audits_for_metadata_snapshots(plan, new_snapshots)
|
|
144
|
+
|
|
145
|
+
# Step 5: Remove intervals for snapshots that need to be restated
|
|
139
146
|
self._restate(plan, snapshots_by_name)
|
|
147
|
+
|
|
148
|
+
# Step 6: Backfill missing intervals for snapshots that can be backfilled before updating
|
|
149
|
+
# the schema of production tables
|
|
140
150
|
first_bf_completion_status = self._backfill(
|
|
141
151
|
plan,
|
|
142
152
|
snapshots_by_name,
|
|
@@ -144,9 +154,15 @@ class BuiltInPlanEvaluator(PlanEvaluator):
|
|
|
144
154
|
deployability_index_for_evaluation,
|
|
145
155
|
circuit_breaker=circuit_breaker,
|
|
146
156
|
)
|
|
157
|
+
|
|
158
|
+
# Step 7: Update the target environment record in the state and migrate table schemas for forward-only
|
|
159
|
+
# snapshots if deploying to production
|
|
147
160
|
promotion_result = self._promote(
|
|
148
161
|
plan, snapshots, before_promote_snapshots, deployability_index_for_creation
|
|
149
162
|
)
|
|
163
|
+
|
|
164
|
+
# Step 8: Backfill missing intervals for snapshots that can be backfilled only after updating
|
|
165
|
+
# the schema of production tables
|
|
150
166
|
second_bf_completion_status = self._backfill(
|
|
151
167
|
plan,
|
|
152
168
|
snapshots_by_name,
|
|
@@ -154,15 +170,20 @@ class BuiltInPlanEvaluator(PlanEvaluator):
|
|
|
154
170
|
deployability_index_for_evaluation,
|
|
155
171
|
circuit_breaker=circuit_breaker,
|
|
156
172
|
)
|
|
173
|
+
|
|
157
174
|
if (
|
|
158
175
|
first_bf_completion_status.is_nothing_to_do
|
|
159
176
|
and second_bf_completion_status.is_nothing_to_do
|
|
160
177
|
):
|
|
161
178
|
self.console.log_success("SKIP: No model batches to execute")
|
|
179
|
+
|
|
180
|
+
# Step 9: Update environment views to point at new physical tables and finalize the environment
|
|
181
|
+
# record in the state
|
|
162
182
|
self._update_views(
|
|
163
183
|
plan, snapshots, promotion_result, deployability_index_for_evaluation
|
|
164
184
|
)
|
|
165
185
|
|
|
186
|
+
# Step 10: Run after_all environment statements
|
|
166
187
|
execute_environment_statements(
|
|
167
188
|
adapter=self.snapshot_evaluator.adapter,
|
|
168
189
|
environment_statements=plan.environment_statements or [],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
sqlmesh/__init__.py,sha256=69xw6bTmi4cW90M-sl3g6wLDgxVcLHcKg1q8GS3lqyA,7466
|
|
2
|
-
sqlmesh/_version.py,sha256=
|
|
2
|
+
sqlmesh/_version.py,sha256=nZNgbGbDzUCLzSZHhV7u6sUFSQ-y2tAU1zZN-q70hlk,528
|
|
3
3
|
sqlmesh/magics.py,sha256=JHorAZNtezf123jmTyNSoUC9yHmv-08hMP205PJmmIo,39750
|
|
4
4
|
sqlmesh/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
sqlmesh/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -93,9 +93,9 @@ sqlmesh/core/model/meta.py,sha256=Hxn5BjfnGATjopHQ4Odok3FoO0X1Ulb2gm6aAvwQhP0,19
|
|
|
93
93
|
sqlmesh/core/model/schema.py,sha256=QzM1cOfukuK3L-cEE9MtxKeYec3x5JvutdZAnczJSiQ,3858
|
|
94
94
|
sqlmesh/core/model/seed.py,sha256=ctUHH6CmeEnBVJyIAZznx0xJBm09W7VIZ-76Cfwfq28,5004
|
|
95
95
|
sqlmesh/core/plan/__init__.py,sha256=ctpnu9mK3uTujs0It8qRMqcj9GdObXDnvSgn4rD2zqc,450
|
|
96
|
-
sqlmesh/core/plan/builder.py,sha256=
|
|
96
|
+
sqlmesh/core/plan/builder.py,sha256=Fd5raxq6r6b_3mOZndiI2U7SmliVYevcrpxWNqRV_OE,38471
|
|
97
97
|
sqlmesh/core/plan/definition.py,sha256=SI3zi2poPkKJKTZogYv60Q7eIOhksaAcFUcu-J2-XqI,13218
|
|
98
|
-
sqlmesh/core/plan/evaluator.py,sha256=
|
|
98
|
+
sqlmesh/core/plan/evaluator.py,sha256=RAHJgQoV5Y5SIG_pV2O_Bn0VFlD1yzMC0UrUU6eaB_E,26842
|
|
99
99
|
sqlmesh/core/snapshot/__init__.py,sha256=Z5HTetNCZGoKF1WAKXk4LWL9dc8EC8lwS2O4TtoBmt4,1317
|
|
100
100
|
sqlmesh/core/snapshot/cache.py,sha256=MRYi_koDvp2yeQ5NDGoNFzhuJTw7Vh7mI0oJyeVbqio,4022
|
|
101
101
|
sqlmesh/core/snapshot/categorizer.py,sha256=qGG5870mu1jR2whKisSBH_GFbsyh96RnzJDgkN7DV9g,2482
|
|
@@ -268,7 +268,7 @@ sqlmesh/utils/pydantic.py,sha256=dywc9i-diWLA3vB-X_28I8NX3BPoSWAjcaP31zkzr0k,111
|
|
|
268
268
|
sqlmesh/utils/rich.py,sha256=xNZyPCqEc4TAlJlsEthg-5eYUWpaizz0QjBzO7a1Yv4,1509
|
|
269
269
|
sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
|
|
270
270
|
sqlmesh/utils/yaml.py,sha256=np-WVcwmwsKghCgAj1OBBMsK1SXSRn4wR-H37cGiFr8,2282
|
|
271
|
-
sqlmesh-0.186.1.
|
|
271
|
+
sqlmesh-0.186.1.dev4.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
|
|
272
272
|
web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
273
273
|
web/client/dist/index.html,sha256=xQIU9G6dbuTnmbHZ61bSYbh0gYz9A2lb4BRwLlXL94Y,5472
|
|
274
274
|
web/client/dist/assets/Audits-Dcl7Y5yf.js,sha256=D2CfXzrdXFdD_-7c51tBJCKNwUY9yGeIpDEaRae7V8I,1041
|
|
@@ -386,8 +386,8 @@ web/server/api/endpoints/models.py,sha256=ud-lRwriyI_OYg9tZchrBgeiXELiRTLNEodraf
|
|
|
386
386
|
web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
|
|
387
387
|
web/server/api/endpoints/plan.py,sha256=OYuQ_4dgbhG9ibTcX1a8mvYgH3ANxw9Fhbb4wg6QWqc,9222
|
|
388
388
|
web/server/api/endpoints/table_diff.py,sha256=Wd5YxeKbZB7AkrDvqFgvV9ZQlnKYOF1n5W_w2EHE_Zw,2085
|
|
389
|
-
sqlmesh-0.186.1.
|
|
390
|
-
sqlmesh-0.186.1.
|
|
391
|
-
sqlmesh-0.186.1.
|
|
392
|
-
sqlmesh-0.186.1.
|
|
393
|
-
sqlmesh-0.186.1.
|
|
389
|
+
sqlmesh-0.186.1.dev4.dist-info/METADATA,sha256=QZQyCEcO0vO_kXhiN3InAityt4DOunO6_rSocKbkfHk,25523
|
|
390
|
+
sqlmesh-0.186.1.dev4.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
391
|
+
sqlmesh-0.186.1.dev4.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
392
|
+
sqlmesh-0.186.1.dev4.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
393
|
+
sqlmesh-0.186.1.dev4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|