sqlmesh 0.196.5.dev9__py3-none-any.whl → 0.196.5.dev11__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/cli/main.py +8 -1
- sqlmesh/core/config/loader.py +8 -0
- sqlmesh/magics.py +8 -1
- {sqlmesh-0.196.5.dev9.dist-info → sqlmesh-0.196.5.dev11.dist-info}/METADATA +2 -1
- {sqlmesh-0.196.5.dev9.dist-info → sqlmesh-0.196.5.dev11.dist-info}/RECORD +10 -10
- {sqlmesh-0.196.5.dev9.dist-info → sqlmesh-0.196.5.dev11.dist-info}/WHEEL +0 -0
- {sqlmesh-0.196.5.dev9.dist-info → sqlmesh-0.196.5.dev11.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.196.5.dev9.dist-info → sqlmesh-0.196.5.dev11.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.196.5.dev9.dist-info → sqlmesh-0.196.5.dev11.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.5.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 196, 5, '
|
|
20
|
+
__version__ = version = '0.196.5.dev11'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 196, 5, 'dev11')
|
sqlmesh/cli/main.py
CHANGED
|
@@ -84,6 +84,12 @@ def _sqlmesh_version() -> str:
|
|
|
84
84
|
type=str,
|
|
85
85
|
help="The directory to write log files to.",
|
|
86
86
|
)
|
|
87
|
+
@click.option(
|
|
88
|
+
"--dotenv",
|
|
89
|
+
type=click.Path(exists=True, path_type=Path),
|
|
90
|
+
help="Path to a custom .env file to load environment variables.",
|
|
91
|
+
envvar="SQLMESH_DOTENV_PATH",
|
|
92
|
+
)
|
|
87
93
|
@click.pass_context
|
|
88
94
|
@error_handler
|
|
89
95
|
def cli(
|
|
@@ -95,6 +101,7 @@ def cli(
|
|
|
95
101
|
debug: bool = False,
|
|
96
102
|
log_to_stdout: bool = False,
|
|
97
103
|
log_file_dir: t.Optional[str] = None,
|
|
104
|
+
dotenv: t.Optional[Path] = None,
|
|
98
105
|
) -> None:
|
|
99
106
|
"""SQLMesh command line tool."""
|
|
100
107
|
if "--help" in sys.argv:
|
|
@@ -118,7 +125,7 @@ def cli(
|
|
|
118
125
|
)
|
|
119
126
|
configure_console(ignore_warnings=ignore_warnings)
|
|
120
127
|
|
|
121
|
-
configs = load_configs(config, Context.CONFIG_TYPE, paths)
|
|
128
|
+
configs = load_configs(config, Context.CONFIG_TYPE, paths, dotenv_path=dotenv)
|
|
122
129
|
log_limit = list(configs.values())[0].log_limit
|
|
123
130
|
|
|
124
131
|
remove_excess_logs(log_file_dir, log_limit)
|
sqlmesh/core/config/loader.py
CHANGED
|
@@ -6,6 +6,7 @@ import typing as t
|
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
|
|
8
8
|
from pydantic import ValidationError
|
|
9
|
+
from dotenv import load_dotenv
|
|
9
10
|
from sqlglot.helper import ensure_list
|
|
10
11
|
|
|
11
12
|
from sqlmesh.core import constants as c
|
|
@@ -25,6 +26,7 @@ def load_configs(
|
|
|
25
26
|
config_type: t.Type[C],
|
|
26
27
|
paths: t.Union[str | Path, t.Iterable[str | Path]],
|
|
27
28
|
sqlmesh_path: t.Optional[Path] = None,
|
|
29
|
+
dotenv_path: t.Optional[Path] = None,
|
|
28
30
|
) -> t.Dict[Path, C]:
|
|
29
31
|
sqlmesh_path = sqlmesh_path or c.SQLMESH_PATH
|
|
30
32
|
config = config or "config"
|
|
@@ -35,6 +37,12 @@ def load_configs(
|
|
|
35
37
|
for p in (glob.glob(str(path)) or [str(path)])
|
|
36
38
|
]
|
|
37
39
|
|
|
40
|
+
if dotenv_path:
|
|
41
|
+
load_dotenv(dotenv_path=dotenv_path, override=True)
|
|
42
|
+
else:
|
|
43
|
+
for path in absolute_paths:
|
|
44
|
+
load_dotenv(dotenv_path=path / ".env", override=True)
|
|
45
|
+
|
|
38
46
|
if not isinstance(config, str):
|
|
39
47
|
if type(config) != config_type:
|
|
40
48
|
config = convert_config_type(config, config_type)
|
sqlmesh/magics.py
CHANGED
|
@@ -8,6 +8,7 @@ import typing as t
|
|
|
8
8
|
from argparse import Namespace, SUPPRESS
|
|
9
9
|
from collections import defaultdict
|
|
10
10
|
from copy import deepcopy
|
|
11
|
+
from pathlib import Path
|
|
11
12
|
|
|
12
13
|
from hyperscript import h
|
|
13
14
|
|
|
@@ -166,6 +167,9 @@ class SQLMeshMagics(Magics):
|
|
|
166
167
|
@argument("--ignore-warnings", action="store_true", help="Ignore warnings.")
|
|
167
168
|
@argument("--debug", action="store_true", help="Enable debug mode.")
|
|
168
169
|
@argument("--log-file-dir", type=str, help="The directory to write the log file to.")
|
|
170
|
+
@argument(
|
|
171
|
+
"--dotenv", type=str, help="Path to a custom .env file to load environment variables from."
|
|
172
|
+
)
|
|
169
173
|
@line_magic
|
|
170
174
|
def context(self, line: str) -> None:
|
|
171
175
|
"""Sets the context in the user namespace."""
|
|
@@ -181,7 +185,10 @@ class SQLMeshMagics(Magics):
|
|
|
181
185
|
)
|
|
182
186
|
configure_console(ignore_warnings=args.ignore_warnings)
|
|
183
187
|
|
|
184
|
-
|
|
188
|
+
dotenv_path = Path(args.dotenv) if args.dotenv else None
|
|
189
|
+
configs = load_configs(
|
|
190
|
+
args.config, Context.CONFIG_TYPE, args.paths, dotenv_path=dotenv_path
|
|
191
|
+
)
|
|
185
192
|
log_limit = list(configs.values())[0].log_limit
|
|
186
193
|
|
|
187
194
|
remove_excess_logs(log_file_dir, log_limit)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sqlmesh
|
|
3
|
-
Version: 0.196.5.
|
|
3
|
+
Version: 0.196.5.dev11
|
|
4
4
|
Summary: Next-generation data transformation framework
|
|
5
5
|
Author-email: "TobikoData Inc." <engineering@tobikodata.com>
|
|
6
6
|
License: Apache License
|
|
@@ -230,6 +230,7 @@ Requires-Dist: jinja2
|
|
|
230
230
|
Requires-Dist: packaging
|
|
231
231
|
Requires-Dist: pandas
|
|
232
232
|
Requires-Dist: pydantic>=2.0.0
|
|
233
|
+
Requires-Dist: python-dotenv
|
|
233
234
|
Requires-Dist: requests
|
|
234
235
|
Requires-Dist: rich[jupyter]
|
|
235
236
|
Requires-Dist: ruamel.yaml
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
sqlmesh/__init__.py,sha256=QjwaamJIdW7voXoS880yAx7tHm-Im4_mqGA-XJgafos,7631
|
|
2
|
-
sqlmesh/_version.py,sha256=
|
|
3
|
-
sqlmesh/magics.py,sha256=
|
|
2
|
+
sqlmesh/_version.py,sha256=bsBxfl39yJcRfYue_GfSBwRx6BqTAFouk_dwsX0i0do,530
|
|
3
|
+
sqlmesh/magics.py,sha256=R9U0Mp9ZQhDYe751nxAQDLaMv3zLAR4HcTdIflKTmEE,41709
|
|
4
4
|
sqlmesh/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
sqlmesh/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
sqlmesh/cicd/bot.py,sha256=2zlbn-DXkqQzr3lA0__IGU4XaIfXBXBKLWXNI2DRJX8,759
|
|
7
7
|
sqlmesh/cicd/config.py,sha256=mpgkisSBBovlNrNZir2unT8Wes6b38RW2UsU_o4e8vY,109
|
|
8
8
|
sqlmesh/cli/__init__.py,sha256=MAXAyO7isbyM-PaSdFjkJNcjn32WjOl0XzxT5gvp_vo,1690
|
|
9
|
-
sqlmesh/cli/main.py,sha256=
|
|
9
|
+
sqlmesh/cli/main.py,sha256=XXWvOcqxb-NYkETEQ7vKRMO1mdiW_xwuFZHW60yTQWg,35858
|
|
10
10
|
sqlmesh/cli/options.py,sha256=-4ZclMIeIg8tghLowtmQNmpEFlm0QtOVEh40NqRdFHA,2499
|
|
11
11
|
sqlmesh/cli/project_init.py,sha256=5JmDmUK0WJs39hM-p76uzHYdo1Hnx6fKuJg_pR3Hn5A,16419
|
|
12
12
|
sqlmesh/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -47,7 +47,7 @@ sqlmesh/core/config/format.py,sha256=6CXFbvnor56xbldKE-Vrm9k_ABRoY4v6vgIb3mCihiQ
|
|
|
47
47
|
sqlmesh/core/config/gateway.py,sha256=tYngyqwd_4Qr9lhcv2hlvLvb_2pgYYtKu6hdGsTr-4I,1931
|
|
48
48
|
sqlmesh/core/config/janitor.py,sha256=NP0i51V8XwMrHw8uuwQknivuudIleNiFBtBnMuXmfIY,362
|
|
49
49
|
sqlmesh/core/config/linter.py,sha256=4Fh6UgY5FrRD9tk_R41Y-M_r91Wh7EQW3Pc1IdRN9Cg,1287
|
|
50
|
-
sqlmesh/core/config/loader.py,sha256=
|
|
50
|
+
sqlmesh/core/config/loader.py,sha256=hgDIrhpCu0G22v73wZq4nixCfqSwEYqomoInbdhVJ6k,7804
|
|
51
51
|
sqlmesh/core/config/migration.py,sha256=3lZIlmIcQH3_hIEm3Y3jFtvpw0YXzRzAnk4OdiklO6M,408
|
|
52
52
|
sqlmesh/core/config/model.py,sha256=GIz9kAfKD2NEXNzCZCQ17-CK2OtqN6WgeG1fvibcChM,3650
|
|
53
53
|
sqlmesh/core/config/naming.py,sha256=KVGaxUgswoQajXR_cHFJvgkmEFcU1V182GkOH1SJxuE,326
|
|
@@ -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.5.
|
|
286
|
+
sqlmesh-0.196.5.dev11.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=kNpFjWxt34Pf-P-cROtPWi3GNSVk6zqA3eoN9tlZXI0,5472
|
|
289
289
|
web/client/dist/assets/Audits-DKgXravk.js,sha256=SaVQhNlislD_yQc_KivO7SPi1JH0ts1GnDPD5Zssutw,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.5.
|
|
405
|
-
sqlmesh-0.196.5.
|
|
406
|
-
sqlmesh-0.196.5.
|
|
407
|
-
sqlmesh-0.196.5.
|
|
408
|
-
sqlmesh-0.196.5.
|
|
404
|
+
sqlmesh-0.196.5.dev11.dist-info/METADATA,sha256=-BwA7XQ-QrIDx-yY9sNbO1EExEjcl9w8v0WvYOs9ltQ,26571
|
|
405
|
+
sqlmesh-0.196.5.dev11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
406
|
+
sqlmesh-0.196.5.dev11.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
407
|
+
sqlmesh-0.196.5.dev11.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
408
|
+
sqlmesh-0.196.5.dev11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|