sqlmesh 0.186.2.dev5__py3-none-any.whl → 0.186.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/config/root.py +6 -2
- sqlmesh/core/table_diff.py +22 -1
- {sqlmesh-0.186.2.dev5.dist-info → sqlmesh-0.186.2.dev7.dist-info}/METADATA +1 -1
- {sqlmesh-0.186.2.dev5.dist-info → sqlmesh-0.186.2.dev7.dist-info}/RECORD +9 -9
- {sqlmesh-0.186.2.dev5.dist-info → sqlmesh-0.186.2.dev7.dist-info}/WHEEL +0 -0
- {sqlmesh-0.186.2.dev5.dist-info → sqlmesh-0.186.2.dev7.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.186.2.dev5.dist-info → sqlmesh-0.186.2.dev7.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.186.2.dev5.dist-info → sqlmesh-0.186.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.186.2.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 186, 2, '
|
|
20
|
+
__version__ = version = '0.186.2.dev7'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 186, 2, 'dev7')
|
sqlmesh/core/config/root.py
CHANGED
|
@@ -122,7 +122,7 @@ class Config(BaseConfig):
|
|
|
122
122
|
"""
|
|
123
123
|
|
|
124
124
|
gateways: GatewayDict = {"": GatewayConfig()}
|
|
125
|
-
default_connection: SerializableConnectionConfig =
|
|
125
|
+
default_connection: t.Optional[SerializableConnectionConfig] = None
|
|
126
126
|
default_test_connection_: t.Optional[SerializableConnectionConfig] = Field(
|
|
127
127
|
default=None, alias="default_test_connection"
|
|
128
128
|
)
|
|
@@ -280,7 +280,11 @@ class Config(BaseConfig):
|
|
|
280
280
|
return self.gateways
|
|
281
281
|
|
|
282
282
|
def get_connection(self, gateway_name: t.Optional[str] = None) -> ConnectionConfig:
|
|
283
|
-
|
|
283
|
+
connection = self.get_gateway(gateway_name).connection or self.default_connection
|
|
284
|
+
if connection is None:
|
|
285
|
+
msg = f" for gateway '{gateway_name}'" if gateway_name else ""
|
|
286
|
+
raise ConfigError(f"No connection configured{msg}.")
|
|
287
|
+
return connection
|
|
284
288
|
|
|
285
289
|
def get_state_connection(
|
|
286
290
|
self, gateway_name: t.Optional[str] = None
|
sqlmesh/core/table_diff.py
CHANGED
|
@@ -8,6 +8,7 @@ import pandas as pd
|
|
|
8
8
|
|
|
9
9
|
from sqlmesh.core.dialect import to_schema
|
|
10
10
|
from sqlmesh.core.engine_adapter.mixins import RowDiffMixin
|
|
11
|
+
from sqlmesh.core.engine_adapter.athena import AthenaEngineAdapter
|
|
11
12
|
from sqlglot import exp, parse_one
|
|
12
13
|
from sqlglot.helper import ensure_list
|
|
13
14
|
from sqlglot.optimizer.normalize_identifiers import normalize_identifiers
|
|
@@ -15,6 +16,7 @@ from sqlglot.optimizer.qualify_columns import quote_identifiers
|
|
|
15
16
|
from sqlglot.optimizer.scope import find_all_in_scope
|
|
16
17
|
|
|
17
18
|
from sqlmesh.utils.pydantic import PydanticModel
|
|
19
|
+
from sqlmesh.utils.errors import SQLMeshError
|
|
18
20
|
|
|
19
21
|
if t.TYPE_CHECKING:
|
|
20
22
|
from sqlmesh.core._typing import TableName
|
|
@@ -431,7 +433,26 @@ class TableDiff:
|
|
|
431
433
|
schema = to_schema(temp_schema, dialect=self.dialect)
|
|
432
434
|
temp_table = exp.table_("diff", db=schema.db, catalog=schema.catalog, quoted=True)
|
|
433
435
|
|
|
434
|
-
|
|
436
|
+
temp_table_kwargs = {}
|
|
437
|
+
if isinstance(self.adapter, AthenaEngineAdapter):
|
|
438
|
+
# Athena has two table formats: Hive (the default) and Iceberg. TableDiff requires that
|
|
439
|
+
# the formats be the same for the source, target, and temp tables.
|
|
440
|
+
source_table_type = self.adapter._query_table_type(self.source_table)
|
|
441
|
+
target_table_type = self.adapter._query_table_type(self.target_table)
|
|
442
|
+
|
|
443
|
+
if source_table_type == "iceberg" and target_table_type == "iceberg":
|
|
444
|
+
temp_table_kwargs["table_format"] = "iceberg"
|
|
445
|
+
# Sets the temp table's format to Iceberg.
|
|
446
|
+
# If neither source nor target table is Iceberg, it defaults to Hive (Athena's default).
|
|
447
|
+
elif source_table_type == "iceberg" or target_table_type == "iceberg":
|
|
448
|
+
raise SQLMeshError(
|
|
449
|
+
f"Source table '{self.source}' format '{source_table_type}' and target table '{self.target}' format '{target_table_type}' "
|
|
450
|
+
f"do not match for Athena. Diffing between different table formats is not supported."
|
|
451
|
+
)
|
|
452
|
+
|
|
453
|
+
with self.adapter.temp_table(
|
|
454
|
+
query, name=temp_table, columns_to_types=None, **temp_table_kwargs
|
|
455
|
+
) as table:
|
|
435
456
|
summary_sums = [
|
|
436
457
|
exp.func("SUM", "s_exists").as_("s_count"),
|
|
437
458
|
exp.func("SUM", "t_exists").as_("t_count"),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
sqlmesh/__init__.py,sha256=69xw6bTmi4cW90M-sl3g6wLDgxVcLHcKg1q8GS3lqyA,7466
|
|
2
|
-
sqlmesh/_version.py,sha256=
|
|
2
|
+
sqlmesh/_version.py,sha256=5Qq3pqXoSjLPVN13IN75WxegsGj69CHuuWXEqsIlVh0,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
|
|
@@ -29,7 +29,7 @@ sqlmesh/core/schema_diff.py,sha256=mE28W51JUQz6q8inSOw2Cds84VPIqPxI6C2ed6xLmrg,2
|
|
|
29
29
|
sqlmesh/core/schema_loader.py,sha256=lvrI9k7hr1P4X4E6t3U-KrcuvdQuw0UdNlN90P2s52w,3563
|
|
30
30
|
sqlmesh/core/selector.py,sha256=9riBQ6gPySg546x0JaXXITw2eZgGe9iVKcynAUJ1mmw,12137
|
|
31
31
|
sqlmesh/core/signal.py,sha256=yVLXewYP6eH0vt-EwaIaI2WwHz6hWsVr-Kb2m4kP1FU,1353
|
|
32
|
-
sqlmesh/core/table_diff.py,sha256=
|
|
32
|
+
sqlmesh/core/table_diff.py,sha256=AbTbmbV5aP-rqa-LT4A1MRnm5K-jmDi2F3N5cz-pFXQ,24838
|
|
33
33
|
sqlmesh/core/user.py,sha256=EJ6R4R1iK67n80vBoCCsidF56IR7xEYqiCEO-nrVMso,1660
|
|
34
34
|
sqlmesh/core/analytics/__init__.py,sha256=ou3ZXAJfQOXEifj-PzaXwMDSvJzsVaqaMkUopiI00kM,3247
|
|
35
35
|
sqlmesh/core/analytics/collector.py,sha256=sggJvER16Jrg5triTC27E2KwaQvfkVDv4D6R1lVPH5I,13058
|
|
@@ -52,7 +52,7 @@ sqlmesh/core/config/migration.py,sha256=3lZIlmIcQH3_hIEm3Y3jFtvpw0YXzRzAnk4Odikl
|
|
|
52
52
|
sqlmesh/core/config/model.py,sha256=GIz9kAfKD2NEXNzCZCQ17-CK2OtqN6WgeG1fvibcChM,3650
|
|
53
53
|
sqlmesh/core/config/naming.py,sha256=KVGaxUgswoQajXR_cHFJvgkmEFcU1V182GkOH1SJxuE,326
|
|
54
54
|
sqlmesh/core/config/plan.py,sha256=Sql_bdO2H_vVrIYosf8rWOTRVoMURciX7mEcbMNFFdg,1389
|
|
55
|
-
sqlmesh/core/config/root.py,sha256=
|
|
55
|
+
sqlmesh/core/config/root.py,sha256=q4yD5S6ZoUvCaDNWkm47rGbvITp0JBfBUC37P1a9I9U,14735
|
|
56
56
|
sqlmesh/core/config/run.py,sha256=rIK0QnN_vArrwps2TXGVEbvao2AnGZgzXo7EliJa42E,852
|
|
57
57
|
sqlmesh/core/config/scheduler.py,sha256=essKKkJ6jD5gRT_l-WiKwGKVO1hpDlnf_UdrCvyN5JY,6786
|
|
58
58
|
sqlmesh/core/config/ui.py,sha256=jsO-S6_d9NkLZGG5pT4mgKgxMF34KzkDociZAMvCX3U,278
|
|
@@ -269,7 +269,7 @@ sqlmesh/utils/pydantic.py,sha256=I898jAFqa3qU6lG2uPpRebVFncOUo8ZrLWM_R3K3DHU,116
|
|
|
269
269
|
sqlmesh/utils/rich.py,sha256=xNZyPCqEc4TAlJlsEthg-5eYUWpaizz0QjBzO7a1Yv4,1509
|
|
270
270
|
sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
|
|
271
271
|
sqlmesh/utils/yaml.py,sha256=np-WVcwmwsKghCgAj1OBBMsK1SXSRn4wR-H37cGiFr8,2282
|
|
272
|
-
sqlmesh-0.186.2.
|
|
272
|
+
sqlmesh-0.186.2.dev7.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
|
|
273
273
|
web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
274
274
|
web/client/dist/index.html,sha256=M50OuwjW63dRCS0Dz40Yecgvw9ecLFqizbTa6gv5Nd4,5472
|
|
275
275
|
web/client/dist/assets/Audits-BPlxzqeG.js,sha256=TCx1qCjCGgmUSvH6HoPr5t8ztbRXMlOxrcW4o7hRjlA,1041
|
|
@@ -387,8 +387,8 @@ web/server/api/endpoints/models.py,sha256=ud-lRwriyI_OYg9tZchrBgeiXELiRTLNEodraf
|
|
|
387
387
|
web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
|
|
388
388
|
web/server/api/endpoints/plan.py,sha256=OYuQ_4dgbhG9ibTcX1a8mvYgH3ANxw9Fhbb4wg6QWqc,9222
|
|
389
389
|
web/server/api/endpoints/table_diff.py,sha256=Wd5YxeKbZB7AkrDvqFgvV9ZQlnKYOF1n5W_w2EHE_Zw,2085
|
|
390
|
-
sqlmesh-0.186.2.
|
|
391
|
-
sqlmesh-0.186.2.
|
|
392
|
-
sqlmesh-0.186.2.
|
|
393
|
-
sqlmesh-0.186.2.
|
|
394
|
-
sqlmesh-0.186.2.
|
|
390
|
+
sqlmesh-0.186.2.dev7.dist-info/METADATA,sha256=mMGGuNn8T4WE0hc6NZIXtl6RrgcRW0v4DA5v05OvHUw,25523
|
|
391
|
+
sqlmesh-0.186.2.dev7.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
392
|
+
sqlmesh-0.186.2.dev7.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
393
|
+
sqlmesh-0.186.2.dev7.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
394
|
+
sqlmesh-0.186.2.dev7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|