sqlmesh 0.196.1.dev4__py3-none-any.whl → 0.196.1.dev6__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/config/connection.py +11 -0
- sqlmesh/core/snapshot/evaluator.py +33 -32
- sqlmesh/dbt/target.py +4 -0
- {sqlmesh-0.196.1.dev4.dist-info → sqlmesh-0.196.1.dev6.dist-info}/METADATA +1 -1
- {sqlmesh-0.196.1.dev4.dist-info → sqlmesh-0.196.1.dev6.dist-info}/RECORD +10 -10
- {sqlmesh-0.196.1.dev4.dist-info → sqlmesh-0.196.1.dev6.dist-info}/WHEEL +0 -0
- {sqlmesh-0.196.1.dev4.dist-info → sqlmesh-0.196.1.dev6.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.196.1.dev4.dist-info → sqlmesh-0.196.1.dev6.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.196.1.dev4.dist-info → sqlmesh-0.196.1.dev6.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.196.1.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 196, 1, '
|
|
20
|
+
__version__ = version = '0.196.1.dev6'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 196, 1, 'dev6')
|
|
@@ -266,6 +266,7 @@ class BaseDuckDBConnectionConfig(ConnectionConfig):
|
|
|
266
266
|
extensions: A list of autoloadable extensions to load.
|
|
267
267
|
connector_config: A dictionary of configuration to pass into the duckdb connector.
|
|
268
268
|
secrets: A list of dictionaries used to generate DuckDB secrets for authenticating with external services (e.g. S3).
|
|
269
|
+
filesystems: A list of dictionaries used to register `fsspec` filesystems to the DuckDB cursor.
|
|
269
270
|
concurrent_tasks: The maximum number of tasks that can use this connection concurrently.
|
|
270
271
|
register_comments: Whether or not to register model comments with the SQL engine.
|
|
271
272
|
pre_ping: Whether or not to pre-ping the connection before starting a new transaction to ensure it is still alive.
|
|
@@ -277,6 +278,7 @@ class BaseDuckDBConnectionConfig(ConnectionConfig):
|
|
|
277
278
|
extensions: t.List[t.Union[str, t.Dict[str, t.Any]]] = []
|
|
278
279
|
connector_config: t.Dict[str, t.Any] = {}
|
|
279
280
|
secrets: t.List[t.Dict[str, t.Any]] = []
|
|
281
|
+
filesystems: t.List[t.Dict[str, t.Any]] = []
|
|
280
282
|
|
|
281
283
|
concurrent_tasks: int = 1
|
|
282
284
|
register_comments: bool = True
|
|
@@ -371,6 +373,15 @@ class BaseDuckDBConnectionConfig(ConnectionConfig):
|
|
|
371
373
|
except Exception as e:
|
|
372
374
|
raise ConfigError(f"Failed to create secret: {e}")
|
|
373
375
|
|
|
376
|
+
if self.filesystems:
|
|
377
|
+
from fsspec import filesystem # type: ignore
|
|
378
|
+
|
|
379
|
+
for file_system in self.filesystems:
|
|
380
|
+
options = file_system.copy()
|
|
381
|
+
fs = options.pop("fs")
|
|
382
|
+
fs = filesystem(fs, **options)
|
|
383
|
+
cursor.register_filesystem(fs)
|
|
384
|
+
|
|
374
385
|
for i, (alias, path_options) in enumerate(
|
|
375
386
|
(getattr(self, "catalogs", None) or {}).items()
|
|
376
387
|
):
|
|
@@ -911,39 +911,40 @@ class SnapshotEvaluator:
|
|
|
911
911
|
):
|
|
912
912
|
return
|
|
913
913
|
|
|
914
|
+
deployability_index = DeployabilityIndex.all_deployable()
|
|
915
|
+
render_kwargs: t.Dict[str, t.Any] = dict(
|
|
916
|
+
engine_adapter=adapter,
|
|
917
|
+
snapshots=parent_snapshots_by_name(snapshot, snapshots),
|
|
918
|
+
runtime_stage=RuntimeStage.CREATING,
|
|
919
|
+
deployability_index=deployability_index,
|
|
920
|
+
)
|
|
914
921
|
target_table_name = snapshot.table_name()
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
deployability_index=deployability_index,
|
|
942
|
-
)
|
|
943
|
-
with (
|
|
944
|
-
adapter.transaction(),
|
|
945
|
-
adapter.session(snapshot.model.render_session_properties(**render_kwargs)),
|
|
946
|
-
):
|
|
922
|
+
|
|
923
|
+
with (
|
|
924
|
+
adapter.transaction(),
|
|
925
|
+
adapter.session(snapshot.model.render_session_properties(**render_kwargs)),
|
|
926
|
+
):
|
|
927
|
+
if adapter.table_exists(target_table_name):
|
|
928
|
+
evaluation_strategy = _evaluation_strategy(snapshot, adapter)
|
|
929
|
+
tmp_table_name = snapshot.table_name(is_deployable=False)
|
|
930
|
+
logger.info(
|
|
931
|
+
"Migrating table schema from '%s' to '%s'",
|
|
932
|
+
tmp_table_name,
|
|
933
|
+
target_table_name,
|
|
934
|
+
)
|
|
935
|
+
evaluation_strategy.migrate(
|
|
936
|
+
target_table_name=target_table_name,
|
|
937
|
+
source_table_name=tmp_table_name,
|
|
938
|
+
snapshot=snapshot,
|
|
939
|
+
snapshots=parent_snapshots_by_name(snapshot, snapshots),
|
|
940
|
+
allow_destructive_snapshots=allow_destructive_snapshots,
|
|
941
|
+
)
|
|
942
|
+
else:
|
|
943
|
+
logger.info(
|
|
944
|
+
"Creating table '%s' for the snapshot of the forward-only model %s",
|
|
945
|
+
target_table_name,
|
|
946
|
+
snapshot.snapshot_id,
|
|
947
|
+
)
|
|
947
948
|
self._execute_create(
|
|
948
949
|
snapshot=snapshot,
|
|
949
950
|
table_name=target_table_name,
|
sqlmesh/dbt/target.py
CHANGED
|
@@ -138,6 +138,7 @@ class DuckDbConfig(TargetConfig):
|
|
|
138
138
|
extensions: A list of autoloadable extensions to load.
|
|
139
139
|
settings: A dictionary of settings to pass into the duckdb connector.
|
|
140
140
|
secrets: A list of secrets to pass to the secret manager in the duckdb connector.
|
|
141
|
+
filesystems: A list of `fsspec` filesystems to register in the duckdb connection.
|
|
141
142
|
"""
|
|
142
143
|
|
|
143
144
|
type: t.Literal["duckdb"] = "duckdb"
|
|
@@ -147,6 +148,7 @@ class DuckDbConfig(TargetConfig):
|
|
|
147
148
|
extensions: t.Optional[t.List[str]] = None
|
|
148
149
|
settings: t.Optional[t.Dict[str, t.Any]] = None
|
|
149
150
|
secrets: t.Optional[t.List[t.Dict[str, t.Any]]] = None
|
|
151
|
+
filesystems: t.Optional[t.List[t.Dict[str, t.Any]]] = None
|
|
150
152
|
|
|
151
153
|
@model_validator(mode="before")
|
|
152
154
|
def validate_authentication(cls, data: t.Any) -> t.Any:
|
|
@@ -182,6 +184,8 @@ class DuckDbConfig(TargetConfig):
|
|
|
182
184
|
kwargs["connector_config"] = self.settings
|
|
183
185
|
if self.secrets is not None:
|
|
184
186
|
kwargs["secrets"] = self.secrets
|
|
187
|
+
if self.filesystems is not None:
|
|
188
|
+
kwargs["filesystems"] = self.filesystems
|
|
185
189
|
return DuckDBConnectionConfig(
|
|
186
190
|
database=self.path,
|
|
187
191
|
concurrent_tasks=1,
|
|
@@ -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=ss8qzuMXEEN16YeHsRoAwO7vZWIY6zgCs81hS4otaiM,528
|
|
3
3
|
sqlmesh/magics.py,sha256=nMfwSW5rIkdnyO9MXYm9u24hNl6dqgAWybC-MnRcNnE,41451
|
|
4
4
|
sqlmesh/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
sqlmesh/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -41,7 +41,7 @@ sqlmesh/core/config/__init__.py,sha256=b4gFb04tpeZpowqJD-7h3U3TLgxrpQhZahVEAo6VW
|
|
|
41
41
|
sqlmesh/core/config/base.py,sha256=t8NQmsgQoZSc-k0dlDiCb8t1jj0AMYdGZ-6se9q_Pks,4898
|
|
42
42
|
sqlmesh/core/config/categorizer.py,sha256=6vzUoNLjR6GOEb_2mYVz2TwmMv2BfldgHX2u-Le5HZs,1975
|
|
43
43
|
sqlmesh/core/config/common.py,sha256=rsb2uVFqPEX3DMsWG_hApwztCuRJP-FAmaQ_5L3-S8g,4006
|
|
44
|
-
sqlmesh/core/config/connection.py,sha256
|
|
44
|
+
sqlmesh/core/config/connection.py,sha256=7-9WN1Rq2j9g_TilRlhxuzO4ugWeN3eCtMkU0Um6lmw,85959
|
|
45
45
|
sqlmesh/core/config/feature_flag.py,sha256=JRcD31OG_t2cYc24meKbHDGB0iVID0P07V2oOeB_mgA,203
|
|
46
46
|
sqlmesh/core/config/format.py,sha256=6CXFbvnor56xbldKE-Vrm9k_ABRoY4v6vgIb3mCihiQ,1355
|
|
47
47
|
sqlmesh/core/config/gateway.py,sha256=tYngyqwd_4Qr9lhcv2hlvLvb_2pgYYtKu6hdGsTr-4I,1931
|
|
@@ -103,7 +103,7 @@ sqlmesh/core/snapshot/__init__.py,sha256=Z5HTetNCZGoKF1WAKXk4LWL9dc8EC8lwS2O4Tto
|
|
|
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=mjGZBpzhKI9gYLmuYhSAs0IBKEo_JdfX66EcR9yRcig,84359
|
|
106
|
-
sqlmesh/core/snapshot/evaluator.py,sha256=
|
|
106
|
+
sqlmesh/core/snapshot/evaluator.py,sha256=RA-ZFwG_BtkXSmls41gHRaCqa-h-evxXsDLE5jtgxvU,90173
|
|
107
107
|
sqlmesh/core/state_sync/__init__.py,sha256=B60xj-_Xk-4jas3UphLvwkuf04G-9AyGckcblXE0aRg,869
|
|
108
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
|
|
@@ -139,7 +139,7 @@ sqlmesh/dbt/project.py,sha256=4PJHPVWIKDd71J5__iICqEp21nFiijKjJkiE5kZIH5Y,3980
|
|
|
139
139
|
sqlmesh/dbt/relation.py,sha256=rgDJQUuENjqq7kpMJJ6AdlgwYmcYjA1oFj6LCYCS-Hg,227
|
|
140
140
|
sqlmesh/dbt/seed.py,sha256=E7pFhtGwRrC9U_VZJNABwLTa-Nk4OeD-gOtjSpvYmDA,4251
|
|
141
141
|
sqlmesh/dbt/source.py,sha256=IZK-aOV-KdWIOPuXqRjJZAZ7phW1HUXoHtE-3clgkx4,4125
|
|
142
|
-
sqlmesh/dbt/target.py,sha256=
|
|
142
|
+
sqlmesh/dbt/target.py,sha256=aHPt0jSb-Rsqg-uGYZY_rwIXUCmJ8YmsaGh2HiczWbI,42831
|
|
143
143
|
sqlmesh/dbt/test.py,sha256=aOTKqYpVafff-TU4Xhbc9eZr6QAuFLMxIu_sV-18JLQ,8282
|
|
144
144
|
sqlmesh/dbt/util.py,sha256=BdtfQ7sxnZ8y8CFJStkePpmRE-KntHCXTefRnXR5Pag,905
|
|
145
145
|
sqlmesh/dbt/converter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -283,7 +283,7 @@ sqlmesh/utils/pydantic.py,sha256=I898jAFqa3qU6lG2uPpRebVFncOUo8ZrLWM_R3K3DHU,116
|
|
|
283
283
|
sqlmesh/utils/rich.py,sha256=BpB47G0-JcU41LkGkeGKroexj4NOV5fox4-GOIXPgIc,3545
|
|
284
284
|
sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
|
|
285
285
|
sqlmesh/utils/yaml.py,sha256=hvo5lmybYLcIx4p6CQwufS8X4MbwS60lEBnCmYJCXmU,2336
|
|
286
|
-
sqlmesh-0.196.1.
|
|
286
|
+
sqlmesh-0.196.1.dev6.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
|
|
287
287
|
web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
288
288
|
web/client/dist/index.html,sha256=drXwzSCEVDTMfaIwzJYjnT8Xk4c-Y4wNJz-CflUa_vY,5472
|
|
289
289
|
web/client/dist/assets/Audits-DrNQaTQA.js,sha256=E8JF632bsRUm6LGtgXlyHrJOYQe5VW2CgRZPaZNKvgg,1041
|
|
@@ -401,8 +401,8 @@ web/server/api/endpoints/models.py,sha256=ud-lRwriyI_OYg9tZchrBgeiXELiRTLNEodraf
|
|
|
401
401
|
web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
|
|
402
402
|
web/server/api/endpoints/plan.py,sha256=OYuQ_4dgbhG9ibTcX1a8mvYgH3ANxw9Fhbb4wg6QWqc,9222
|
|
403
403
|
web/server/api/endpoints/table_diff.py,sha256=SCy3-pr5x6bEEiOaZGCDbiHQhpgxwmnz3Acqa2Ie6jI,2090
|
|
404
|
-
sqlmesh-0.196.1.
|
|
405
|
-
sqlmesh-0.196.1.
|
|
406
|
-
sqlmesh-0.196.1.
|
|
407
|
-
sqlmesh-0.196.1.
|
|
408
|
-
sqlmesh-0.196.1.
|
|
404
|
+
sqlmesh-0.196.1.dev6.dist-info/METADATA,sha256=MUshvxIdlIMCB-pCyTJkcOz4TP1tnWXG4WNsCy9YmjM,26690
|
|
405
|
+
sqlmesh-0.196.1.dev6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
406
|
+
sqlmesh-0.196.1.dev6.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
407
|
+
sqlmesh-0.196.1.dev6.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
408
|
+
sqlmesh-0.196.1.dev6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|