sqlmesh 0.194.2.dev6__py3-none-any.whl → 0.194.2.dev7__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/context.py +14 -8
- sqlmesh/core/state_sync/base.py +3 -3
- sqlmesh/core/state_sync/db/environment.py +9 -12
- sqlmesh/core/state_sync/db/facade.py +2 -2
- {sqlmesh-0.194.2.dev6.dist-info → sqlmesh-0.194.2.dev7.dist-info}/METADATA +1 -1
- {sqlmesh-0.194.2.dev6.dist-info → sqlmesh-0.194.2.dev7.dist-info}/RECORD +11 -11
- {sqlmesh-0.194.2.dev6.dist-info → sqlmesh-0.194.2.dev7.dist-info}/WHEEL +0 -0
- {sqlmesh-0.194.2.dev6.dist-info → sqlmesh-0.194.2.dev7.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.194.2.dev6.dist-info → sqlmesh-0.194.2.dev7.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.194.2.dev6.dist-info → sqlmesh-0.194.2.dev7.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.194.2.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 194, 2, '
|
|
20
|
+
__version__ = version = '0.194.2.dev7'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 194, 2, 'dev7')
|
sqlmesh/core/context.py
CHANGED
|
@@ -2695,16 +2695,22 @@ class GenericContext(BaseContext, t.Generic[C]):
|
|
|
2695
2695
|
def _cleanup_environments(self, current_ts: t.Optional[int] = None) -> None:
|
|
2696
2696
|
current_ts = current_ts or now_timestamp()
|
|
2697
2697
|
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
cleanup_expired_views(
|
|
2701
|
-
default_adapter=self.engine_adapter,
|
|
2702
|
-
engine_adapters=self.engine_adapters,
|
|
2703
|
-
environments=expired_environments,
|
|
2704
|
-
warn_on_delete_failure=self.config.janitor.warn_on_delete_failure,
|
|
2705
|
-
console=self.console,
|
|
2698
|
+
expired_environments_summaries = self.state_sync.get_expired_environments(
|
|
2699
|
+
current_ts=current_ts
|
|
2706
2700
|
)
|
|
2707
2701
|
|
|
2702
|
+
for expired_env_summary in expired_environments_summaries:
|
|
2703
|
+
expired_env = self.state_reader.get_environment(expired_env_summary.name)
|
|
2704
|
+
|
|
2705
|
+
if expired_env:
|
|
2706
|
+
cleanup_expired_views(
|
|
2707
|
+
default_adapter=self.engine_adapter,
|
|
2708
|
+
engine_adapters=self.engine_adapters,
|
|
2709
|
+
environments=[expired_env],
|
|
2710
|
+
warn_on_delete_failure=self.config.janitor.warn_on_delete_failure,
|
|
2711
|
+
console=self.console,
|
|
2712
|
+
)
|
|
2713
|
+
|
|
2708
2714
|
self.state_sync.delete_expired_environments(current_ts=current_ts)
|
|
2709
2715
|
|
|
2710
2716
|
def _try_connection(self, connection_name: str, validator: t.Callable[[], None]) -> None:
|
sqlmesh/core/state_sync/base.py
CHANGED
|
@@ -304,12 +304,12 @@ class StateReader(abc.ABC):
|
|
|
304
304
|
"""
|
|
305
305
|
|
|
306
306
|
@abc.abstractmethod
|
|
307
|
-
def get_expired_environments(self, current_ts: int) -> t.List[
|
|
307
|
+
def get_expired_environments(self, current_ts: int) -> t.List[EnvironmentSummary]:
|
|
308
308
|
"""Returns the expired environments.
|
|
309
309
|
|
|
310
310
|
Expired environments are environments that have exceeded their time-to-live value.
|
|
311
311
|
Returns:
|
|
312
|
-
The list of
|
|
312
|
+
The list of environment summaries to remove.
|
|
313
313
|
"""
|
|
314
314
|
|
|
315
315
|
|
|
@@ -418,7 +418,7 @@ class StateSync(StateReader, abc.ABC):
|
|
|
418
418
|
@abc.abstractmethod
|
|
419
419
|
def delete_expired_environments(
|
|
420
420
|
self, current_ts: t.Optional[int] = None
|
|
421
|
-
) -> t.List[
|
|
421
|
+
) -> t.List[EnvironmentSummary]:
|
|
422
422
|
"""Removes expired environments.
|
|
423
423
|
|
|
424
424
|
Expired environments are environments that have exceeded their time-to-live value.
|
|
@@ -165,27 +165,24 @@ class EnvironmentState:
|
|
|
165
165
|
where=environment_filter,
|
|
166
166
|
)
|
|
167
167
|
|
|
168
|
-
def get_expired_environments(self, current_ts: int) -> t.List[
|
|
168
|
+
def get_expired_environments(self, current_ts: int) -> t.List[EnvironmentSummary]:
|
|
169
169
|
"""Returns the expired environments.
|
|
170
170
|
|
|
171
171
|
Expired environments are environments that have exceeded their time-to-live value.
|
|
172
172
|
Returns:
|
|
173
|
-
The list of
|
|
173
|
+
The list of environment summaries to remove.
|
|
174
174
|
"""
|
|
175
|
-
rows = fetchall(
|
|
176
|
-
self.engine_adapter,
|
|
177
|
-
self._environments_query(
|
|
178
|
-
where=self._create_expiration_filter_expr(current_ts),
|
|
179
|
-
lock_for_update=True,
|
|
180
|
-
),
|
|
181
|
-
)
|
|
182
|
-
expired_environments = [self._environment_from_row(r) for r in rows]
|
|
183
175
|
|
|
184
|
-
|
|
176
|
+
environment_summaries = self.get_environments_summary()
|
|
177
|
+
return [
|
|
178
|
+
env_summary
|
|
179
|
+
for env_summary in environment_summaries
|
|
180
|
+
if env_summary.expiration_ts is not None and env_summary.expiration_ts <= current_ts
|
|
181
|
+
]
|
|
185
182
|
|
|
186
183
|
def delete_expired_environments(
|
|
187
184
|
self, current_ts: t.Optional[int] = None
|
|
188
|
-
) -> t.List[
|
|
185
|
+
) -> t.List[EnvironmentSummary]:
|
|
189
186
|
"""Deletes expired environments.
|
|
190
187
|
|
|
191
188
|
Returns:
|
|
@@ -274,7 +274,7 @@ class EngineAdapterStateSync(StateSync):
|
|
|
274
274
|
self.environment_state.get_environments(), current_ts=current_ts, ignore_ttl=ignore_ttl
|
|
275
275
|
)
|
|
276
276
|
|
|
277
|
-
def get_expired_environments(self, current_ts: int) -> t.List[
|
|
277
|
+
def get_expired_environments(self, current_ts: int) -> t.List[EnvironmentSummary]:
|
|
278
278
|
return self.environment_state.get_expired_environments(current_ts=current_ts)
|
|
279
279
|
|
|
280
280
|
@transactional()
|
|
@@ -294,7 +294,7 @@ class EngineAdapterStateSync(StateSync):
|
|
|
294
294
|
@transactional()
|
|
295
295
|
def delete_expired_environments(
|
|
296
296
|
self, current_ts: t.Optional[int] = None
|
|
297
|
-
) -> t.List[
|
|
297
|
+
) -> t.List[EnvironmentSummary]:
|
|
298
298
|
current_ts = current_ts or now_timestamp()
|
|
299
299
|
return self.environment_state.delete_expired_environments(current_ts=current_ts)
|
|
300
300
|
|
|
@@ -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=Omv_hcyAbbAlwk8BL-W2pa08QqNBOgKWdTu0VFY5oNI,528
|
|
3
3
|
sqlmesh/magics.py,sha256=ysPC5ohXpgQ8IHQPwtQtwGoVypmVq_YBlm1noUueDIw,40448
|
|
4
4
|
sqlmesh/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
sqlmesh/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -13,7 +13,7 @@ sqlmesh/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
13
13
|
sqlmesh/core/_typing.py,sha256=e1f7xO2aZCy38M_3VoDy-XI3shyd99-IFctgIFSgXWM,497
|
|
14
14
|
sqlmesh/core/console.py,sha256=pMIkBjaigneVqGkoGxOKVmT423RPfbDKX8TQ8D1SzpU,153466
|
|
15
15
|
sqlmesh/core/constants.py,sha256=gUABXWYgH_XOSbaZAJsR5o1dmA61JDCvBDyxqqXX3LM,2630
|
|
16
|
-
sqlmesh/core/context.py,sha256=
|
|
16
|
+
sqlmesh/core/context.py,sha256=jo-qLN33tDXEI7G2_r7inSDAAzQ6H97rFdN3M2z7lk8,118394
|
|
17
17
|
sqlmesh/core/context_diff.py,sha256=TCzM8egBE35DskpouOB-GQM2Qf5iUHWbRgiB5yZ6tzg,21552
|
|
18
18
|
sqlmesh/core/dialect.py,sha256=93cXYVuNoZ9CvJNTVn2Yz7WDOdHINwVXflbn0eZ-p14,49764
|
|
19
19
|
sqlmesh/core/environment.py,sha256=7DbJX0r5nZRU3LhcgIxbSV-JosQYDjAt3V5Wc2Fpns8,13005
|
|
@@ -105,13 +105,13 @@ sqlmesh/core/snapshot/categorizer.py,sha256=qGG5870mu1jR2whKisSBH_GFbsyh96RnzJDg
|
|
|
105
105
|
sqlmesh/core/snapshot/definition.py,sha256=mjGZBpzhKI9gYLmuYhSAs0IBKEo_JdfX66EcR9yRcig,84359
|
|
106
106
|
sqlmesh/core/snapshot/evaluator.py,sha256=zuxNnEKCyImFIT_hWLNc7xtKv4uflkKXOLprkD_hCJE,90132
|
|
107
107
|
sqlmesh/core/state_sync/__init__.py,sha256=B60xj-_Xk-4jas3UphLvwkuf04G-9AyGckcblXE0aRg,869
|
|
108
|
-
sqlmesh/core/state_sync/base.py,sha256=
|
|
108
|
+
sqlmesh/core/state_sync/base.py,sha256=Drq4MDWWxO_J-sJIxsMG1-YSgj2L42n5WM2vh1sr6bc,18334
|
|
109
109
|
sqlmesh/core/state_sync/cache.py,sha256=0AsYdQyBqbLdJvkBQ-hDAipsvnn_jSps-nya-Q4XeL0,5337
|
|
110
110
|
sqlmesh/core/state_sync/common.py,sha256=x8Nkox6VmkD-lYZkjRcNe3iVsChR1HBroTorf1kATpQ,7609
|
|
111
111
|
sqlmesh/core/state_sync/export_import.py,sha256=WJ7sFX2b_RPAFE4yspJRi_4JQnaO23xpJgRxwXD0agA,8709
|
|
112
112
|
sqlmesh/core/state_sync/db/__init__.py,sha256=jGCqKYB7npq4eh6H2LyfBAJWdOP-IFu0DC4CMiQgYvw,107
|
|
113
|
-
sqlmesh/core/state_sync/db/environment.py,sha256=
|
|
114
|
-
sqlmesh/core/state_sync/db/facade.py,sha256=
|
|
113
|
+
sqlmesh/core/state_sync/db/environment.py,sha256=2SiuztOz1zz7Fd1ZckL67KniQBy5LUzxICH-GScGiWo,13555
|
|
114
|
+
sqlmesh/core/state_sync/db/facade.py,sha256=lQKeMPtY6ooKDlhSFmnmSgiUdELfKkKfnNuHrlvL9F8,25333
|
|
115
115
|
sqlmesh/core/state_sync/db/interval.py,sha256=qDo5qX7vulibbg9M8mDA0PjoQQJlUCouBJeWuTuLJ6Y,18043
|
|
116
116
|
sqlmesh/core/state_sync/db/migrator.py,sha256=2LNUwOBNFkA1ntp-Z93S_OWxFQhOBj3ZD_ZqPCyPEAE,18139
|
|
117
117
|
sqlmesh/core/state_sync/db/snapshot.py,sha256=7ccdRxni4UGAul-_15z6-I9GAifC94jfNTvAdUEQ9pw,29480
|
|
@@ -282,7 +282,7 @@ sqlmesh/utils/pydantic.py,sha256=I898jAFqa3qU6lG2uPpRebVFncOUo8ZrLWM_R3K3DHU,116
|
|
|
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=np-WVcwmwsKghCgAj1OBBMsK1SXSRn4wR-H37cGiFr8,2282
|
|
285
|
-
sqlmesh-0.194.2.
|
|
285
|
+
sqlmesh-0.194.2.dev7.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=w71qWSLmp-xwmVJO8m41k8Rtni3iZlF0hmhiTr-NeCI,5472
|
|
288
288
|
web/client/dist/assets/Audits-sYYNn2gO.js,sha256=zSAKkif2kU0JuPH05xjNYITNPmsbDlvLKUc2-orr8AY,1041
|
|
@@ -400,8 +400,8 @@ web/server/api/endpoints/models.py,sha256=ud-lRwriyI_OYg9tZchrBgeiXELiRTLNEodraf
|
|
|
400
400
|
web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
|
|
401
401
|
web/server/api/endpoints/plan.py,sha256=OYuQ_4dgbhG9ibTcX1a8mvYgH3ANxw9Fhbb4wg6QWqc,9222
|
|
402
402
|
web/server/api/endpoints/table_diff.py,sha256=SCy3-pr5x6bEEiOaZGCDbiHQhpgxwmnz3Acqa2Ie6jI,2090
|
|
403
|
-
sqlmesh-0.194.2.
|
|
404
|
-
sqlmesh-0.194.2.
|
|
405
|
-
sqlmesh-0.194.2.
|
|
406
|
-
sqlmesh-0.194.2.
|
|
407
|
-
sqlmesh-0.194.2.
|
|
403
|
+
sqlmesh-0.194.2.dev7.dist-info/METADATA,sha256=kS4QdxiytgvQvp-u38wE6yPFc-WStHHHYIcIsHczTTI,26690
|
|
404
|
+
sqlmesh-0.194.2.dev7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
405
|
+
sqlmesh-0.194.2.dev7.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
406
|
+
sqlmesh-0.194.2.dev7.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
407
|
+
sqlmesh-0.194.2.dev7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|