sqlmesh 0.209.1.dev25__py3-none-any.whl → 0.209.1.dev27__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/engine_adapter/bigquery.py +7 -0
- sqlmesh/core/snapshot/evaluator.py +16 -5
- sqlmesh/dbt/adapter.py +23 -3
- {sqlmesh-0.209.1.dev25.dist-info → sqlmesh-0.209.1.dev27.dist-info}/METADATA +1 -1
- {sqlmesh-0.209.1.dev25.dist-info → sqlmesh-0.209.1.dev27.dist-info}/RECORD +10 -10
- {sqlmesh-0.209.1.dev25.dist-info → sqlmesh-0.209.1.dev27.dist-info}/WHEEL +0 -0
- {sqlmesh-0.209.1.dev25.dist-info → sqlmesh-0.209.1.dev27.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.209.1.dev25.dist-info → sqlmesh-0.209.1.dev27.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.209.1.dev25.dist-info → sqlmesh-0.209.1.dev27.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.209.1.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 209, 1, '
|
|
20
|
+
__version__ = version = '0.209.1.dev27'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 209, 1, 'dev27')
|
|
@@ -292,6 +292,13 @@ class BigQueryEngineAdapter(InsertOverwriteWithMergeMixin, ClusteredByMixin, Row
|
|
|
292
292
|
raise
|
|
293
293
|
logger.warning("Failed to create schema '%s': %s", schema_name, e)
|
|
294
294
|
|
|
295
|
+
def get_bq_schema(self, table_name: TableName) -> t.List[bigquery.SchemaField]:
|
|
296
|
+
table = exp.to_table(table_name)
|
|
297
|
+
if len(table.parts) == 3 and "." in table.name:
|
|
298
|
+
self.execute(exp.select("*").from_(table).limit(0))
|
|
299
|
+
return self._query_job._query_results.schema
|
|
300
|
+
return self._get_table(table).schema
|
|
301
|
+
|
|
295
302
|
def columns(
|
|
296
303
|
self, table_name: TableName, include_pseudo_columns: bool = False
|
|
297
304
|
) -> t.Dict[str, exp.DataType]:
|
|
@@ -1073,11 +1073,22 @@ class SnapshotEvaluator:
|
|
|
1073
1073
|
|
|
1074
1074
|
evaluation_strategy = _evaluation_strategy(snapshot, adapter)
|
|
1075
1075
|
for is_table_deployable, table_name in table_names:
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1076
|
+
try:
|
|
1077
|
+
evaluation_strategy.delete(
|
|
1078
|
+
table_name,
|
|
1079
|
+
is_table_deployable=is_table_deployable,
|
|
1080
|
+
physical_schema=snapshot.physical_schema,
|
|
1081
|
+
)
|
|
1082
|
+
except Exception:
|
|
1083
|
+
# Use `get_data_object` to check if the table exists instead of `table_exists` since the former
|
|
1084
|
+
# is based on `INFORMATION_SCHEMA` and avoids touching the table directly.
|
|
1085
|
+
# This is important when the table name is malformed for some reason and running any statement
|
|
1086
|
+
# that touches the table would result in an error.
|
|
1087
|
+
if adapter.get_data_object(table_name) is not None:
|
|
1088
|
+
raise
|
|
1089
|
+
logger.warning(
|
|
1090
|
+
"Skipping cleanup of table '%s' because it does not exist", table_name
|
|
1091
|
+
)
|
|
1081
1092
|
|
|
1082
1093
|
if on_complete is not None:
|
|
1083
1094
|
on_complete(table_name)
|
sqlmesh/dbt/adapter.py
CHANGED
|
@@ -291,11 +291,31 @@ class RuntimeAdapter(BaseAdapter):
|
|
|
291
291
|
return relations
|
|
292
292
|
|
|
293
293
|
def get_columns_in_relation(self, relation: BaseRelation) -> t.List[Column]:
|
|
294
|
-
from dbt.adapters.base.column import Column
|
|
295
|
-
|
|
296
294
|
mapped_table = self._map_table_name(self._normalize(self._relation_to_table(relation)))
|
|
295
|
+
|
|
296
|
+
if self.project_dialect == "bigquery":
|
|
297
|
+
# dbt.adapters.bigquery.column.BigQueryColumn has a different constructor signature
|
|
298
|
+
# We need to use BigQueryColumn.create_from_field() to create the column instead
|
|
299
|
+
if (
|
|
300
|
+
hasattr(self.column_type, "create_from_field")
|
|
301
|
+
and callable(getattr(self.column_type, "create_from_field"))
|
|
302
|
+
and hasattr(self.engine_adapter, "get_bq_schema")
|
|
303
|
+
and callable(getattr(self.engine_adapter, "get_bq_schema"))
|
|
304
|
+
):
|
|
305
|
+
return [
|
|
306
|
+
self.column_type.create_from_field(field) # type: ignore
|
|
307
|
+
for field in self.engine_adapter.get_bq_schema(mapped_table) # type: ignore
|
|
308
|
+
]
|
|
309
|
+
from dbt.adapters.base.column import Column
|
|
310
|
+
|
|
311
|
+
return [
|
|
312
|
+
Column.from_description(
|
|
313
|
+
name=name, raw_data_type=dtype.sql(dialect=self.project_dialect)
|
|
314
|
+
)
|
|
315
|
+
for name, dtype in self.engine_adapter.columns(table_name=mapped_table).items()
|
|
316
|
+
]
|
|
297
317
|
return [
|
|
298
|
-
|
|
318
|
+
self.column_type.from_description(
|
|
299
319
|
name=name, raw_data_type=dtype.sql(dialect=self.project_dialect)
|
|
300
320
|
)
|
|
301
321
|
for name, dtype in self.engine_adapter.columns(table_name=mapped_table).items()
|
|
@@ -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=cU4bY2nCwPM_IBbArkeYCEcRnQV5_Gx8bfXVU3NbDLk,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
|
|
@@ -61,7 +61,7 @@ sqlmesh/core/engine_adapter/_typing.py,sha256=_63pYCThfC39UtPVHY3N0H6qJ1YBT32Oqw
|
|
|
61
61
|
sqlmesh/core/engine_adapter/athena.py,sha256=AS1w_l_VrFZsc2CIicElg1dtS9y6q5hHHmTg4ECH-xs,26453
|
|
62
62
|
sqlmesh/core/engine_adapter/base.py,sha256=wwbWWmNv3T0caxp76rw8J1BVwhSaF6joL7-D75w6zsA,105632
|
|
63
63
|
sqlmesh/core/engine_adapter/base_postgres.py,sha256=DOsOdCJyQAVfA9S0GznuH0J1bonMqYVP_yJLDYcxFYM,6772
|
|
64
|
-
sqlmesh/core/engine_adapter/bigquery.py,sha256=
|
|
64
|
+
sqlmesh/core/engine_adapter/bigquery.py,sha256=bwknp6xDR24VBoUdMDcpICPEMXCESLIa9EhXG6mC-6E,53159
|
|
65
65
|
sqlmesh/core/engine_adapter/clickhouse.py,sha256=LoPdm_s_s-ZxS1XJPA3Et0iOHeJ1LgqTAFbwBdiqE7A,34912
|
|
66
66
|
sqlmesh/core/engine_adapter/databricks.py,sha256=8ZExPIeT3dDh9MTJW8udvmh9LiY-f9HkRAN1Q5Qebhs,14541
|
|
67
67
|
sqlmesh/core/engine_adapter/duckdb.py,sha256=bv1kfcaDtYlAtJBjxxfteG-dIf31-6r-NipfgtNbFKQ,7133
|
|
@@ -104,7 +104,7 @@ sqlmesh/core/snapshot/__init__.py,sha256=Z5HTetNCZGoKF1WAKXk4LWL9dc8EC8lwS2O4Tto
|
|
|
104
104
|
sqlmesh/core/snapshot/cache.py,sha256=bgqCR2hyf6r2A_8QP1EnXFK25gDX37-Zg0YeMuETWxg,3934
|
|
105
105
|
sqlmesh/core/snapshot/categorizer.py,sha256=qGG5870mu1jR2whKisSBH_GFbsyh96RnzJDgkN7DV9g,2482
|
|
106
106
|
sqlmesh/core/snapshot/definition.py,sha256=RRlpahl5hfzcR34X8L6_xLR5X5e3ihPwWZKkS7wg2gE,90433
|
|
107
|
-
sqlmesh/core/snapshot/evaluator.py,sha256=
|
|
107
|
+
sqlmesh/core/snapshot/evaluator.py,sha256=3v_qBMbwYHiSFCxa0Wkt_LVJQbElleS_CFSL4ZhwJ30,92708
|
|
108
108
|
sqlmesh/core/state_sync/__init__.py,sha256=B60xj-_Xk-4jas3UphLvwkuf04G-9AyGckcblXE0aRg,869
|
|
109
109
|
sqlmesh/core/state_sync/base.py,sha256=AdqWmbhnvRFqVcFK6L01uCvpBVAYGuMrm4P0D3u_NaU,18334
|
|
110
110
|
sqlmesh/core/state_sync/cache.py,sha256=0AsYdQyBqbLdJvkBQ-hDAipsvnn_jSps-nya-Q4XeL0,5337
|
|
@@ -125,7 +125,7 @@ sqlmesh/core/test/discovery.py,sha256=WXIwPidLoacAGHoT_3TVFFEKamG89nHNtaMsZ01uGj
|
|
|
125
125
|
sqlmesh/core/test/result.py,sha256=6gOKEsERciHhcrw9TedtNr7g1ynTO7UwA5-PPrzvYuM,4564
|
|
126
126
|
sqlmesh/core/test/runner.py,sha256=8I-cL7Q9CggLvET_GPkrXB2YjlyCIHrvbFbbRDnSHRE,6169
|
|
127
127
|
sqlmesh/dbt/__init__.py,sha256=KUv-lW5sG9D2ceXAIzA4MLcjyhzq3E-7qJP4P_PH2EU,144
|
|
128
|
-
sqlmesh/dbt/adapter.py,sha256=
|
|
128
|
+
sqlmesh/dbt/adapter.py,sha256=WPR8EQimP4Yrra_lQmqGKUTUcA8zTYDtK6oH_i_kGI8,18006
|
|
129
129
|
sqlmesh/dbt/basemodel.py,sha256=YmrgE53nrRdo4kCFkuivOPRnqhmAnQ1_XVqxYjGmNRI,12731
|
|
130
130
|
sqlmesh/dbt/builtin.py,sha256=p4E1rmSLM0B5PHcFWA9J7FwScR90pIPqiMN8G4M3sBM,15173
|
|
131
131
|
sqlmesh/dbt/column.py,sha256=Kvj_N3D_QegcoNQG7VqRiqy-FRfupud-6ilhlykBOgE,1873
|
|
@@ -291,7 +291,7 @@ sqlmesh/utils/pydantic.py,sha256=o_NsXbIpDqNpUA1Uc5xF0ZzoXQYYB0DfHwdRxBwXPNk,120
|
|
|
291
291
|
sqlmesh/utils/rich.py,sha256=cwQ5nJ6sgz64xHtoh6_ec7ReV5YpsOGhMtUJnwoRfEI,3549
|
|
292
292
|
sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
|
|
293
293
|
sqlmesh/utils/yaml.py,sha256=hvo5lmybYLcIx4p6CQwufS8X4MbwS60lEBnCmYJCXmU,2336
|
|
294
|
-
sqlmesh-0.209.1.
|
|
294
|
+
sqlmesh-0.209.1.dev27.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
|
|
295
295
|
sqlmesh_dbt/__init__.py,sha256=awYS5y5mz-1NUmx6i5h5NSTJ7tidRl9NC0FAnFWSF6U,350
|
|
296
296
|
sqlmesh_dbt/cli.py,sha256=Ekn77WLMmyyr31aoDoWrZp5DS0rfiddy7pNohBK8G0s,2115
|
|
297
297
|
sqlmesh_dbt/console.py,sha256=1B0B5_R1DlrEkyWVDl8G78-B6_K-ZtLPsQEhqPCfLEU,188
|
|
@@ -413,8 +413,8 @@ web/server/api/endpoints/models.py,sha256=kwj0s7uve3iZSMfmjkoPVMFMeY1sD0peTeyrWf
|
|
|
413
413
|
web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
|
|
414
414
|
web/server/api/endpoints/plan.py,sha256=bbbY50W_2MsZSTxOHWMKz0tbIm75nsRSlPy8GI2fg9Q,9306
|
|
415
415
|
web/server/api/endpoints/table_diff.py,sha256=SCy3-pr5x6bEEiOaZGCDbiHQhpgxwmnz3Acqa2Ie6jI,2090
|
|
416
|
-
sqlmesh-0.209.1.
|
|
417
|
-
sqlmesh-0.209.1.
|
|
418
|
-
sqlmesh-0.209.1.
|
|
419
|
-
sqlmesh-0.209.1.
|
|
420
|
-
sqlmesh-0.209.1.
|
|
416
|
+
sqlmesh-0.209.1.dev27.dist-info/METADATA,sha256=74HQ7TEMWHaKlOERzvf5ACXexoqwGG7g2qwx0TmXAfw,26686
|
|
417
|
+
sqlmesh-0.209.1.dev27.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
418
|
+
sqlmesh-0.209.1.dev27.dist-info/entry_points.txt,sha256=sHAf6tQczIM8xZoduN4qaUjV7QEPVUUW_LCT8EDUMv4,155
|
|
419
|
+
sqlmesh-0.209.1.dev27.dist-info/top_level.txt,sha256=RQ-33FPe2IgL0rgossAfJkCRtqslz9b7wFARqiWLC5Q,24
|
|
420
|
+
sqlmesh-0.209.1.dev27.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|