sqlmesh 0.188.2.dev19__py3-none-any.whl → 0.188.2.dev20__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/trino.py +21 -1
- sqlmesh/core/model/meta.py +9 -1
- {sqlmesh-0.188.2.dev19.dist-info → sqlmesh-0.188.2.dev20.dist-info}/METADATA +1 -1
- {sqlmesh-0.188.2.dev19.dist-info → sqlmesh-0.188.2.dev20.dist-info}/RECORD +9 -9
- {sqlmesh-0.188.2.dev19.dist-info → sqlmesh-0.188.2.dev20.dist-info}/WHEEL +0 -0
- {sqlmesh-0.188.2.dev19.dist-info → sqlmesh-0.188.2.dev20.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.188.2.dev19.dist-info → sqlmesh-0.188.2.dev20.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.188.2.dev19.dist-info → sqlmesh-0.188.2.dev20.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.188.2.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 188, 2, '
|
|
20
|
+
__version__ = version = '0.188.2.dev20'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 188, 2, 'dev20')
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import contextlib
|
|
2
4
|
import re
|
|
3
5
|
import typing as t
|
|
4
6
|
from functools import lru_cache
|
|
@@ -28,7 +30,7 @@ from sqlmesh.core.schema_diff import SchemaDiffer
|
|
|
28
30
|
from sqlmesh.utils.date import TimeLike
|
|
29
31
|
|
|
30
32
|
if t.TYPE_CHECKING:
|
|
31
|
-
from sqlmesh.core._typing import SchemaName, TableName
|
|
33
|
+
from sqlmesh.core._typing import SchemaName, SessionProperties, TableName
|
|
32
34
|
from sqlmesh.core.engine_adapter._typing import DF, QueryOrDF
|
|
33
35
|
|
|
34
36
|
|
|
@@ -87,6 +89,24 @@ class TrinoEngineAdapter(
|
|
|
87
89
|
)
|
|
88
90
|
return seq_get(row, 0) or self.DEFAULT_CATALOG_TYPE
|
|
89
91
|
|
|
92
|
+
@contextlib.contextmanager
|
|
93
|
+
def session(self, properties: SessionProperties) -> t.Iterator[None]:
|
|
94
|
+
authorization = properties.get("authorization")
|
|
95
|
+
if not authorization:
|
|
96
|
+
yield
|
|
97
|
+
return
|
|
98
|
+
|
|
99
|
+
if not isinstance(authorization, exp.Expression):
|
|
100
|
+
authorization = exp.Literal.string(authorization)
|
|
101
|
+
|
|
102
|
+
authorization_sql = authorization.sql(dialect=self.dialect)
|
|
103
|
+
|
|
104
|
+
self.execute(f"SET SESSION AUTHORIZATION {authorization_sql}")
|
|
105
|
+
try:
|
|
106
|
+
yield
|
|
107
|
+
finally:
|
|
108
|
+
self.execute(f"RESET SESSION AUTHORIZATION")
|
|
109
|
+
|
|
90
110
|
def _insert_overwrite_by_condition(
|
|
91
111
|
self,
|
|
92
112
|
table_name: TableName,
|
sqlmesh/core/model/meta.py
CHANGED
|
@@ -319,7 +319,9 @@ class ModelMeta(_Node):
|
|
|
319
319
|
return parsed_session_properties
|
|
320
320
|
|
|
321
321
|
for eq in parsed_session_properties:
|
|
322
|
-
|
|
322
|
+
prop_name = eq.left.name
|
|
323
|
+
|
|
324
|
+
if prop_name == "query_label":
|
|
323
325
|
query_label = eq.right
|
|
324
326
|
if not (
|
|
325
327
|
isinstance(query_label, exp.Array)
|
|
@@ -345,6 +347,12 @@ class ModelMeta(_Node):
|
|
|
345
347
|
raise ConfigError(
|
|
346
348
|
"Invalid entry in `session_properties.query_label`. Must be tuples of string literals with length 2."
|
|
347
349
|
)
|
|
350
|
+
elif prop_name == "authorization":
|
|
351
|
+
authorization = eq.right
|
|
352
|
+
if not (isinstance(authorization, exp.Literal) and authorization.is_string):
|
|
353
|
+
raise ConfigError(
|
|
354
|
+
"Invalid value for `session_properties.authorization`. Must be a string literal."
|
|
355
|
+
)
|
|
348
356
|
|
|
349
357
|
return parsed_session_properties
|
|
350
358
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
sqlmesh/__init__.py,sha256=69xw6bTmi4cW90M-sl3g6wLDgxVcLHcKg1q8GS3lqyA,7466
|
|
2
|
-
sqlmesh/_version.py,sha256=
|
|
2
|
+
sqlmesh/_version.py,sha256=FZ4GQzIfAnyi099UPXOELaeJzxjvR8F1iwdhWsw7-JQ,530
|
|
3
3
|
sqlmesh/magics.py,sha256=fu7-OeT_0_TAkWZOLoiioE3-3iFpvTRxFCbQUlRnfuw,39944
|
|
4
4
|
sqlmesh/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
sqlmesh/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -74,7 +74,7 @@ sqlmesh/core/engine_adapter/risingwave.py,sha256=YYCQ0EJaSrR9_P1_2_LmElQ6zSxqkZz
|
|
|
74
74
|
sqlmesh/core/engine_adapter/shared.py,sha256=NyF2osSJDWPp7KlJUBR4GZcS_cJFr4daUPvhGyp4XcQ,12909
|
|
75
75
|
sqlmesh/core/engine_adapter/snowflake.py,sha256=MVDDcKrc3ROyM3dwT7LEDeQWtisJ9zT61z0oyj4v30I,27196
|
|
76
76
|
sqlmesh/core/engine_adapter/spark.py,sha256=sYkVOPS0X43UPbI0z7Hh_EpKlI36qkOcr4NNFOTQlLs,21045
|
|
77
|
-
sqlmesh/core/engine_adapter/trino.py,sha256=
|
|
77
|
+
sqlmesh/core/engine_adapter/trino.py,sha256=AefxwlgE-lw9OgzWa0lHsyL7WTqRMBZwymtNakEZSOo,15567
|
|
78
78
|
sqlmesh/core/linter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
79
79
|
sqlmesh/core/linter/definition.py,sha256=UL05OjFBfoLSYGWXNf4zjZYzIKr-OyFIMIcIh7RhR8s,5237
|
|
80
80
|
sqlmesh/core/linter/rule.py,sha256=p8rbMbf2Z18ZJ6ZcZyoCk-3Lvo7d_Gvc35tiwWXvuQs,2579
|
|
@@ -89,7 +89,7 @@ sqlmesh/core/model/common.py,sha256=vbcXFhWE22-FeKYAVIlKWvTb-wkeC8XISjU_TIlak0c,
|
|
|
89
89
|
sqlmesh/core/model/decorator.py,sha256=v_sVudNROGrtj5cZ3vgcOFnwPdzwoUGY6REAkQpIMQc,8927
|
|
90
90
|
sqlmesh/core/model/definition.py,sha256=3UG3s1Vbj5VTSiC7sIsbF07JJWJZLGiEebXQta1n82s,108461
|
|
91
91
|
sqlmesh/core/model/kind.py,sha256=i6_AMBarXPGPoMdF9kzBkyqS9tu__a2339-BoX7TgCM,36010
|
|
92
|
-
sqlmesh/core/model/meta.py,sha256=
|
|
92
|
+
sqlmesh/core/model/meta.py,sha256=TRsCztBea2gSknPQxoY1ct13hdWgD0mM9XTHqu5KDgs,21167
|
|
93
93
|
sqlmesh/core/model/schema.py,sha256=OClbAeA8LpW-IiSiLT_TlDWkEqmIIvSk0GXq8SWI-GQ,3443
|
|
94
94
|
sqlmesh/core/model/seed.py,sha256=a0M-1zY1gOkN5ph2GQyataEdBSCtq50YjeFk2LyvInI,5058
|
|
95
95
|
sqlmesh/core/plan/__init__.py,sha256=ctpnu9mK3uTujs0It8qRMqcj9GdObXDnvSgn4rD2zqc,450
|
|
@@ -270,7 +270,7 @@ sqlmesh/utils/pydantic.py,sha256=I898jAFqa3qU6lG2uPpRebVFncOUo8ZrLWM_R3K3DHU,116
|
|
|
270
270
|
sqlmesh/utils/rich.py,sha256=xNZyPCqEc4TAlJlsEthg-5eYUWpaizz0QjBzO7a1Yv4,1509
|
|
271
271
|
sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
|
|
272
272
|
sqlmesh/utils/yaml.py,sha256=np-WVcwmwsKghCgAj1OBBMsK1SXSRn4wR-H37cGiFr8,2282
|
|
273
|
-
sqlmesh-0.188.2.
|
|
273
|
+
sqlmesh-0.188.2.dev20.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
|
|
274
274
|
web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
275
275
|
web/client/dist/index.html,sha256=LbR9XrOXE77otBPoDnaomssYz6h2TBwLANs6hUJ0p2M,5472
|
|
276
276
|
web/client/dist/assets/Audits-DB1HcP9M.js,sha256=eGI_Soj69Jntsixw1NqQpdwG94N5jipQZv7T1Y7WUSs,1041
|
|
@@ -388,8 +388,8 @@ web/server/api/endpoints/models.py,sha256=ud-lRwriyI_OYg9tZchrBgeiXELiRTLNEodraf
|
|
|
388
388
|
web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
|
|
389
389
|
web/server/api/endpoints/plan.py,sha256=OYuQ_4dgbhG9ibTcX1a8mvYgH3ANxw9Fhbb4wg6QWqc,9222
|
|
390
390
|
web/server/api/endpoints/table_diff.py,sha256=Wd5YxeKbZB7AkrDvqFgvV9ZQlnKYOF1n5W_w2EHE_Zw,2085
|
|
391
|
-
sqlmesh-0.188.2.
|
|
392
|
-
sqlmesh-0.188.2.
|
|
393
|
-
sqlmesh-0.188.2.
|
|
394
|
-
sqlmesh-0.188.2.
|
|
395
|
-
sqlmesh-0.188.2.
|
|
391
|
+
sqlmesh-0.188.2.dev20.dist-info/METADATA,sha256=zJikk61ejOvQ6pq-6871cqsCYyRvl9rlQqUvyLuBai8,26532
|
|
392
|
+
sqlmesh-0.188.2.dev20.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
393
|
+
sqlmesh-0.188.2.dev20.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
394
|
+
sqlmesh-0.188.2.dev20.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
395
|
+
sqlmesh-0.188.2.dev20.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|