sqlmesh 0.187.3.dev2__py3-none-any.whl → 0.187.4__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 +6 -1
- sqlmesh/core/environment.py +35 -5
- sqlmesh/dbt/loader.py +10 -15
- {sqlmesh-0.187.3.dev2.dist-info → sqlmesh-0.187.4.dist-info}/METADATA +1 -1
- {sqlmesh-0.187.3.dev2.dist-info → sqlmesh-0.187.4.dist-info}/RECORD +10 -10
- {sqlmesh-0.187.3.dev2.dist-info → sqlmesh-0.187.4.dist-info}/WHEEL +0 -0
- {sqlmesh-0.187.3.dev2.dist-info → sqlmesh-0.187.4.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.187.3.dev2.dist-info → sqlmesh-0.187.4.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.187.3.dev2.dist-info → sqlmesh-0.187.4.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.187.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 187,
|
|
20
|
+
__version__ = version = '0.187.4'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 187, 4)
|
|
@@ -1974,13 +1974,18 @@ def _connection_config_validator(
|
|
|
1974
1974
|
) -> ConnectionConfig | None:
|
|
1975
1975
|
if v is None or isinstance(v, ConnectionConfig):
|
|
1976
1976
|
return v
|
|
1977
|
+
|
|
1978
|
+
check_config_and_vars_msg = "\n\nVerify your config.yaml and environment variables."
|
|
1979
|
+
|
|
1977
1980
|
try:
|
|
1978
1981
|
return parse_connection_config(v)
|
|
1979
1982
|
except pydantic.ValidationError as e:
|
|
1980
1983
|
raise ConfigError(
|
|
1981
1984
|
validation_error_message(e, f"Invalid '{v['type']}' connection config:")
|
|
1982
|
-
+
|
|
1985
|
+
+ check_config_and_vars_msg
|
|
1983
1986
|
)
|
|
1987
|
+
except ConfigError as e:
|
|
1988
|
+
raise ConfigError(str(e) + check_config_and_vars_msg)
|
|
1984
1989
|
|
|
1985
1990
|
|
|
1986
1991
|
connection_config_validator: t.Callable = field_validator(
|
sqlmesh/core/environment.py
CHANGED
|
@@ -250,6 +250,39 @@ class EnvironmentStatements(PydanticModel):
|
|
|
250
250
|
python_env: t.Dict[str, Executable]
|
|
251
251
|
jinja_macros: t.Optional[JinjaMacroRegistry] = None
|
|
252
252
|
|
|
253
|
+
def render_before_all(
|
|
254
|
+
self,
|
|
255
|
+
dialect: str,
|
|
256
|
+
default_catalog: t.Optional[str] = None,
|
|
257
|
+
**render_kwargs: t.Any,
|
|
258
|
+
) -> t.List[str]:
|
|
259
|
+
return self.render(RuntimeStage.BEFORE_ALL, dialect, default_catalog, **render_kwargs)
|
|
260
|
+
|
|
261
|
+
def render_after_all(
|
|
262
|
+
self,
|
|
263
|
+
dialect: str,
|
|
264
|
+
default_catalog: t.Optional[str] = None,
|
|
265
|
+
**render_kwargs: t.Any,
|
|
266
|
+
) -> t.List[str]:
|
|
267
|
+
return self.render(RuntimeStage.AFTER_ALL, dialect, default_catalog, **render_kwargs)
|
|
268
|
+
|
|
269
|
+
def render(
|
|
270
|
+
self,
|
|
271
|
+
runtime_stage: RuntimeStage,
|
|
272
|
+
dialect: str,
|
|
273
|
+
default_catalog: t.Optional[str] = None,
|
|
274
|
+
**render_kwargs: t.Any,
|
|
275
|
+
) -> t.List[str]:
|
|
276
|
+
return render_statements(
|
|
277
|
+
statements=getattr(self, runtime_stage.value),
|
|
278
|
+
dialect=dialect,
|
|
279
|
+
default_catalog=default_catalog,
|
|
280
|
+
python_env=self.python_env,
|
|
281
|
+
jinja_macros=self.jinja_macros,
|
|
282
|
+
runtime_stage=runtime_stage,
|
|
283
|
+
**render_kwargs,
|
|
284
|
+
)
|
|
285
|
+
|
|
253
286
|
|
|
254
287
|
def execute_environment_statements(
|
|
255
288
|
adapter: EngineAdapter,
|
|
@@ -266,18 +299,15 @@ def execute_environment_statements(
|
|
|
266
299
|
rendered_expressions = [
|
|
267
300
|
expr
|
|
268
301
|
for statements in environment_statements
|
|
269
|
-
for expr in
|
|
270
|
-
|
|
302
|
+
for expr in statements.render(
|
|
303
|
+
runtime_stage=runtime_stage,
|
|
271
304
|
dialect=adapter.dialect,
|
|
272
305
|
default_catalog=default_catalog,
|
|
273
|
-
python_env=statements.python_env,
|
|
274
|
-
jinja_macros=statements.jinja_macros,
|
|
275
306
|
snapshots=snapshots,
|
|
276
307
|
start=start,
|
|
277
308
|
end=end,
|
|
278
309
|
execution_time=execution_time,
|
|
279
310
|
environment_naming_info=environment_naming_info,
|
|
280
|
-
runtime_stage=runtime_stage,
|
|
281
311
|
engine_adapter=adapter,
|
|
282
312
|
)
|
|
283
313
|
]
|
sqlmesh/dbt/loader.py
CHANGED
|
@@ -4,7 +4,6 @@ import logging
|
|
|
4
4
|
import sys
|
|
5
5
|
import typing as t
|
|
6
6
|
import sqlmesh.core.dialect as d
|
|
7
|
-
from sqlglot.optimizer.simplify import gen
|
|
8
7
|
from pathlib import Path
|
|
9
8
|
from sqlmesh.core import constants as c
|
|
10
9
|
from sqlmesh.core.config import (
|
|
@@ -17,9 +16,9 @@ from sqlmesh.core.environment import EnvironmentStatements
|
|
|
17
16
|
from sqlmesh.core.loader import CacheBase, LoadedProject, Loader
|
|
18
17
|
from sqlmesh.core.macros import MacroRegistry, macro
|
|
19
18
|
from sqlmesh.core.model import Model, ModelCache
|
|
20
|
-
from sqlmesh.core.model.common import make_python_env
|
|
21
19
|
from sqlmesh.core.signal import signal
|
|
22
20
|
from sqlmesh.dbt.basemodel import BMC, BaseModelConfig
|
|
21
|
+
from sqlmesh.dbt.common import Dependencies
|
|
23
22
|
from sqlmesh.dbt.context import DbtContext
|
|
24
23
|
from sqlmesh.dbt.model import ModelConfig
|
|
25
24
|
from sqlmesh.dbt.profile import Profile
|
|
@@ -259,22 +258,18 @@ class DbtLoader(Loader):
|
|
|
259
258
|
|
|
260
259
|
if statements := on_run_start + on_run_end:
|
|
261
260
|
jinja_references, used_variables = extract_macro_references_and_variables(
|
|
262
|
-
*
|
|
261
|
+
*statements
|
|
263
262
|
)
|
|
264
263
|
|
|
265
|
-
|
|
266
|
-
|
|
264
|
+
statements_context = context.context_for_dependencies(
|
|
265
|
+
Dependencies(
|
|
266
|
+
variables=used_variables,
|
|
267
|
+
)
|
|
267
268
|
)
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
[s for stmt in statements for s in d.parse(stmt, default_dialect=dialect)],
|
|
271
|
-
jinja_macro_references=jinja_references,
|
|
272
|
-
module_path=self.config_path,
|
|
273
|
-
macros=macros,
|
|
274
|
-
variables=context.variables,
|
|
275
|
-
used_variables=used_variables,
|
|
276
|
-
path=self.config_path,
|
|
269
|
+
jinja_registry = make_jinja_registry(
|
|
270
|
+
statements_context.jinja_macros, package_name, jinja_references
|
|
277
271
|
)
|
|
272
|
+
jinja_registry.add_globals(statements_context.jinja_globals)
|
|
278
273
|
|
|
279
274
|
hooks_by_package_name[package_name] = EnvironmentStatements(
|
|
280
275
|
before_all=[
|
|
@@ -285,7 +280,7 @@ class DbtLoader(Loader):
|
|
|
285
280
|
d.jinja_statement(stmt).sql(dialect=dialect)
|
|
286
281
|
for stmt in on_run_end or []
|
|
287
282
|
],
|
|
288
|
-
python_env=
|
|
283
|
+
python_env={},
|
|
289
284
|
jinja_macros=jinja_registry,
|
|
290
285
|
)
|
|
291
286
|
# Project hooks should be executed first and then rest of the packages
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
sqlmesh/__init__.py,sha256=69xw6bTmi4cW90M-sl3g6wLDgxVcLHcKg1q8GS3lqyA,7466
|
|
2
|
-
sqlmesh/_version.py,sha256=
|
|
2
|
+
sqlmesh/_version.py,sha256=b9dc2xFQ0-Cz91Rw9ZLnKviHsBGFeD5AOnhNvCLTlJM,515
|
|
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
|
|
@@ -16,7 +16,7 @@ sqlmesh/core/constants.py,sha256=oqt6zjepUhQoWlgapKn_HpG7Pu9mrFwepdX5caNfJUI,249
|
|
|
16
16
|
sqlmesh/core/context.py,sha256=gOwToFkXSQjb71Ki3cEqfxYjS64p2T2XKfZPVBtjGQA,115624
|
|
17
17
|
sqlmesh/core/context_diff.py,sha256=s9toP17d4tJfOpFH91LcjGK2CM64PVuB0MPkeFgF4hQ,20415
|
|
18
18
|
sqlmesh/core/dialect.py,sha256=fPTV517IOS0nWMxYznNNQnXkQkFFrPOSKe8ghsQ0o8A,49759
|
|
19
|
-
sqlmesh/core/environment.py,sha256=
|
|
19
|
+
sqlmesh/core/environment.py,sha256=Fsih6WZ7Tx4ec0XIlmIIspUWcmijPNW5uHPRQSWuhA8,12315
|
|
20
20
|
sqlmesh/core/lineage.py,sha256=zjB0Zfamo2Fja2r5SSZPMbrEKTXr1WjozZPVqvxdybI,3143
|
|
21
21
|
sqlmesh/core/loader.py,sha256=exNCHmw06-CRBtOk-Hk5Ivw3gCowDWbxcvhMJVxpDd8,35887
|
|
22
22
|
sqlmesh/core/macros.py,sha256=wSKkFDZ2eIvhPENIsQ_7j27zVMHIgT-2juRjGvDeEKM,59620
|
|
@@ -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=-o_HoRFtR4u84frg_TLno7z7vS9II6ASiOayb59MKHo,2806
|
|
44
|
-
sqlmesh/core/config/connection.py,sha256=
|
|
44
|
+
sqlmesh/core/config/connection.py,sha256=09Wf3Ge4Moj_YebVMhfkIIr2fn19InMweGUZ2SO0GE4,75959
|
|
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
|
|
@@ -127,7 +127,7 @@ sqlmesh/dbt/builtin.py,sha256=fyzv4qR1isfnID1oWz-r46oDQvS90DN5mMUEWgapvN8,15153
|
|
|
127
127
|
sqlmesh/dbt/column.py,sha256=Kvj_N3D_QegcoNQG7VqRiqy-FRfupud-6ilhlykBOgE,1873
|
|
128
128
|
sqlmesh/dbt/common.py,sha256=g4PAL-sEdlnfb_zT-WW3xh-oamyCUoK8dUiDEMVwDWI,7804
|
|
129
129
|
sqlmesh/dbt/context.py,sha256=dxClM-G1IeMbP0v5yxC_va8QNU-uKghW2dBlSZHJOk0,10331
|
|
130
|
-
sqlmesh/dbt/loader.py,sha256=
|
|
130
|
+
sqlmesh/dbt/loader.py,sha256=H-ky9kNd7QgSvBvCXsf8le3E3v3RUhNJOwwPSH0ud1M,15760
|
|
131
131
|
sqlmesh/dbt/manifest.py,sha256=iKfUWiqydIW3YnX6hqWAzRc-TmhiXfVFS7e29XJaS6E,22906
|
|
132
132
|
sqlmesh/dbt/model.py,sha256=-TqeldZAqW-4g84Xi_16DpUD3atImk_9OHMbATIKYb8,26328
|
|
133
133
|
sqlmesh/dbt/package.py,sha256=WM5Ve6o0QPW3rZxhw1xbr3yX2619I5KtHOKK1qe5mfU,4291
|
|
@@ -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.187.
|
|
273
|
+
sqlmesh-0.187.4.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=M50OuwjW63dRCS0Dz40Yecgvw9ecLFqizbTa6gv5Nd4,5472
|
|
276
276
|
web/client/dist/assets/Audits-BPlxzqeG.js,sha256=TCx1qCjCGgmUSvH6HoPr5t8ztbRXMlOxrcW4o7hRjlA,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.187.
|
|
392
|
-
sqlmesh-0.187.
|
|
393
|
-
sqlmesh-0.187.
|
|
394
|
-
sqlmesh-0.187.
|
|
395
|
-
sqlmesh-0.187.
|
|
391
|
+
sqlmesh-0.187.4.dist-info/METADATA,sha256=X12PmC1NFNyckJMpTXzGYCWxwUsesqz6dfv7ZuSO3AU,25545
|
|
392
|
+
sqlmesh-0.187.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
393
|
+
sqlmesh-0.187.4.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
394
|
+
sqlmesh-0.187.4.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
395
|
+
sqlmesh-0.187.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|