sqlmesh 0.199.1.dev32__py3-none-any.whl → 0.199.1.dev34__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/context.py +6 -4
- sqlmesh/core/macros.py +3 -3
- sqlmesh/core/model/definition.py +17 -8
- sqlmesh/core/node.py +1 -1
- sqlmesh/core/renderer.py +1 -1
- sqlmesh/core/snapshot/definition.py +1 -1
- sqlmesh/dbt/converter/convert.py +6 -0
- sqlmesh/lsp/reference.py +8 -0
- sqlmesh/magics.py +6 -4
- {sqlmesh-0.199.1.dev32.dist-info → sqlmesh-0.199.1.dev34.dist-info}/METADATA +1 -1
- {sqlmesh-0.199.1.dev32.dist-info → sqlmesh-0.199.1.dev34.dist-info}/RECORD +19 -19
- web/server/api/endpoints/models.py +3 -2
- web/server/models.py +2 -2
- web/server/settings.py +1 -1
- {sqlmesh-0.199.1.dev32.dist-info → sqlmesh-0.199.1.dev34.dist-info}/WHEEL +0 -0
- {sqlmesh-0.199.1.dev32.dist-info → sqlmesh-0.199.1.dev34.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.199.1.dev32.dist-info → sqlmesh-0.199.1.dev34.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.199.1.dev32.dist-info → sqlmesh-0.199.1.dev34.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.199.1.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 199, 1, '
|
|
20
|
+
__version__ = version = '0.199.1.dev34'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 199, 1, 'dev34')
|
sqlmesh/core/context.py
CHANGED
|
@@ -948,10 +948,12 @@ class GenericContext(BaseContext, t.Generic[C]):
|
|
|
948
948
|
|
|
949
949
|
def config_for_node(self, node: str | Model | Audit) -> Config:
|
|
950
950
|
if isinstance(node, str):
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
951
|
+
path = self.get_snapshot(node, raise_if_missing=True).node._path
|
|
952
|
+
else:
|
|
953
|
+
path = node._path
|
|
954
|
+
if path is None:
|
|
955
|
+
return self.config
|
|
956
|
+
return self.config_for_path(path)[0] # type: ignore
|
|
955
957
|
|
|
956
958
|
@property
|
|
957
959
|
def models(self) -> MappingProxyType[str, Model]:
|
sqlmesh/core/macros.py
CHANGED
|
@@ -171,7 +171,7 @@ class MacroEvaluator:
|
|
|
171
171
|
resolve_tables: t.Optional[t.Callable[[exp.Expression], exp.Expression]] = None,
|
|
172
172
|
snapshots: t.Optional[t.Dict[str, Snapshot]] = None,
|
|
173
173
|
default_catalog: t.Optional[str] = None,
|
|
174
|
-
path: Path =
|
|
174
|
+
path: t.Optional[Path] = None,
|
|
175
175
|
environment_naming_info: t.Optional[EnvironmentNamingInfo] = None,
|
|
176
176
|
model_fqn: t.Optional[str] = None,
|
|
177
177
|
):
|
|
@@ -1384,7 +1384,7 @@ for m in macro.get_registry().values():
|
|
|
1384
1384
|
def call_macro(
|
|
1385
1385
|
func: t.Callable,
|
|
1386
1386
|
dialect: DialectType,
|
|
1387
|
-
path: Path,
|
|
1387
|
+
path: t.Optional[Path],
|
|
1388
1388
|
provided_args: t.Tuple[t.Any, ...],
|
|
1389
1389
|
provided_kwargs: t.Dict[str, t.Any],
|
|
1390
1390
|
**optional_kwargs: t.Any,
|
|
@@ -1431,7 +1431,7 @@ def _coerce(
|
|
|
1431
1431
|
expr: t.Any,
|
|
1432
1432
|
typ: t.Any,
|
|
1433
1433
|
dialect: DialectType,
|
|
1434
|
-
path: Path,
|
|
1434
|
+
path: t.Optional[Path] = None,
|
|
1435
1435
|
strict: bool = False,
|
|
1436
1436
|
) -> t.Any:
|
|
1437
1437
|
"""Coerces the given expression to the specified type on a best-effort basis."""
|
sqlmesh/core/model/definition.py
CHANGED
|
@@ -1648,6 +1648,8 @@ class SeedModel(_Model):
|
|
|
1648
1648
|
def seed_path(self) -> Path:
|
|
1649
1649
|
seed_path = Path(self.kind.path)
|
|
1650
1650
|
if not seed_path.is_absolute():
|
|
1651
|
+
if self._path is None:
|
|
1652
|
+
raise SQLMeshError(f"Seed model '{self.name}' has no path")
|
|
1651
1653
|
return self._path.parent / seed_path
|
|
1652
1654
|
return seed_path
|
|
1653
1655
|
|
|
@@ -2022,7 +2024,7 @@ def load_sql_based_model(
|
|
|
2022
2024
|
expressions: t.List[exp.Expression],
|
|
2023
2025
|
*,
|
|
2024
2026
|
defaults: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2025
|
-
path: Path =
|
|
2027
|
+
path: t.Optional[Path] = None,
|
|
2026
2028
|
module_path: Path = Path(),
|
|
2027
2029
|
time_column_format: str = c.DEFAULT_TIME_COLUMN_FORMAT,
|
|
2028
2030
|
macros: t.Optional[MacroRegistry] = None,
|
|
@@ -2173,6 +2175,8 @@ Learn more at https://sqlmesh.readthedocs.io/en/stable/concepts/models/overview
|
|
|
2173
2175
|
# The name of the model will be inferred from its path relative to `models/`, if it's not explicitly specified
|
|
2174
2176
|
name = meta_fields.pop("name", "")
|
|
2175
2177
|
if not name and infer_names:
|
|
2178
|
+
if path is None:
|
|
2179
|
+
raise ValueError(f"Model {name} must have a name")
|
|
2176
2180
|
name = get_model_name(path)
|
|
2177
2181
|
|
|
2178
2182
|
if not name:
|
|
@@ -2251,7 +2255,7 @@ def create_seed_model(
|
|
|
2251
2255
|
name: TableName,
|
|
2252
2256
|
seed_kind: SeedKind,
|
|
2253
2257
|
*,
|
|
2254
|
-
path: Path =
|
|
2258
|
+
path: t.Optional[Path] = None,
|
|
2255
2259
|
module_path: Path = Path(),
|
|
2256
2260
|
**kwargs: t.Any,
|
|
2257
2261
|
) -> Model:
|
|
@@ -2270,7 +2274,12 @@ def create_seed_model(
|
|
|
2270
2274
|
seed_path = module_path.joinpath(*subdirs)
|
|
2271
2275
|
seed_kind.path = str(seed_path)
|
|
2272
2276
|
elif not seed_path.is_absolute():
|
|
2273
|
-
|
|
2277
|
+
if path is None:
|
|
2278
|
+
seed_path = seed_path
|
|
2279
|
+
elif path.is_dir():
|
|
2280
|
+
seed_path = path / seed_path
|
|
2281
|
+
else:
|
|
2282
|
+
seed_path = path.parent / seed_path
|
|
2274
2283
|
|
|
2275
2284
|
seed = create_seed(seed_path)
|
|
2276
2285
|
|
|
@@ -2405,7 +2414,7 @@ def _create_model(
|
|
|
2405
2414
|
name: TableName,
|
|
2406
2415
|
*,
|
|
2407
2416
|
defaults: t.Optional[t.Dict[str, t.Any]] = None,
|
|
2408
|
-
path: Path =
|
|
2417
|
+
path: t.Optional[Path] = None,
|
|
2409
2418
|
time_column_format: str = c.DEFAULT_TIME_COLUMN_FORMAT,
|
|
2410
2419
|
jinja_macros: t.Optional[JinjaMacroRegistry] = None,
|
|
2411
2420
|
jinja_macro_references: t.Optional[t.Set[MacroReference]] = None,
|
|
@@ -2593,7 +2602,7 @@ INSERT_SEED_MACRO_CALL = d.parse_one("@INSERT_SEED()")
|
|
|
2593
2602
|
|
|
2594
2603
|
def _split_sql_model_statements(
|
|
2595
2604
|
expressions: t.List[exp.Expression],
|
|
2596
|
-
path: Path,
|
|
2605
|
+
path: t.Optional[Path],
|
|
2597
2606
|
dialect: t.Optional[str] = None,
|
|
2598
2607
|
) -> t.Tuple[
|
|
2599
2608
|
t.Optional[exp.Expression],
|
|
@@ -2714,7 +2723,7 @@ def _refs_to_sql(values: t.Any) -> exp.Expression:
|
|
|
2714
2723
|
def render_meta_fields(
|
|
2715
2724
|
fields: t.Dict[str, t.Any],
|
|
2716
2725
|
module_path: Path,
|
|
2717
|
-
path: Path,
|
|
2726
|
+
path: t.Optional[Path],
|
|
2718
2727
|
jinja_macros: t.Optional[JinjaMacroRegistry],
|
|
2719
2728
|
macros: t.Optional[MacroRegistry],
|
|
2720
2729
|
dialect: DialectType,
|
|
@@ -2801,7 +2810,7 @@ def render_meta_fields(
|
|
|
2801
2810
|
def render_model_defaults(
|
|
2802
2811
|
defaults: t.Dict[str, t.Any],
|
|
2803
2812
|
module_path: Path,
|
|
2804
|
-
path: Path,
|
|
2813
|
+
path: t.Optional[Path],
|
|
2805
2814
|
jinja_macros: t.Optional[JinjaMacroRegistry],
|
|
2806
2815
|
macros: t.Optional[MacroRegistry],
|
|
2807
2816
|
dialect: DialectType,
|
|
@@ -2851,7 +2860,7 @@ def parse_defaults_properties(
|
|
|
2851
2860
|
def render_expression(
|
|
2852
2861
|
expression: exp.Expression,
|
|
2853
2862
|
module_path: Path,
|
|
2854
|
-
path: Path,
|
|
2863
|
+
path: t.Optional[Path],
|
|
2855
2864
|
jinja_macros: t.Optional[JinjaMacroRegistry] = None,
|
|
2856
2865
|
macros: t.Optional[MacroRegistry] = None,
|
|
2857
2866
|
dialect: DialectType = None,
|
sqlmesh/core/node.py
CHANGED
|
@@ -199,7 +199,7 @@ class _Node(PydanticModel):
|
|
|
199
199
|
interval_unit_: t.Optional[IntervalUnit] = Field(alias="interval_unit", default=None)
|
|
200
200
|
tags: t.List[str] = []
|
|
201
201
|
stamp: t.Optional[str] = None
|
|
202
|
-
_path: Path =
|
|
202
|
+
_path: t.Optional[Path] = None
|
|
203
203
|
_data_hash: t.Optional[str] = None
|
|
204
204
|
_metadata_hash: t.Optional[str] = None
|
|
205
205
|
|
sqlmesh/core/renderer.py
CHANGED
|
@@ -43,7 +43,7 @@ class BaseExpressionRenderer:
|
|
|
43
43
|
expression: exp.Expression,
|
|
44
44
|
dialect: DialectType,
|
|
45
45
|
macro_definitions: t.List[d.MacroDef],
|
|
46
|
-
path: Path =
|
|
46
|
+
path: t.Optional[Path] = None,
|
|
47
47
|
jinja_macro_registry: t.Optional[JinjaMacroRegistry] = None,
|
|
48
48
|
python_env: t.Optional[t.Dict[str, Executable]] = None,
|
|
49
49
|
only_execution_time: bool = False,
|
|
@@ -2198,7 +2198,7 @@ def check_ready_intervals(
|
|
|
2198
2198
|
context: ExecutionContext,
|
|
2199
2199
|
python_env: t.Dict[str, Executable],
|
|
2200
2200
|
dialect: DialectType = None,
|
|
2201
|
-
path: Path =
|
|
2201
|
+
path: t.Optional[Path] = None,
|
|
2202
2202
|
kwargs: t.Optional[t.Dict] = None,
|
|
2203
2203
|
) -> Intervals:
|
|
2204
2204
|
checked_intervals: Intervals = []
|
sqlmesh/dbt/converter/convert.py
CHANGED
|
@@ -207,6 +207,8 @@ def _convert_models(
|
|
|
207
207
|
|
|
208
208
|
if model.kind.is_seed:
|
|
209
209
|
# this will produce the original seed file, eg "items.csv"
|
|
210
|
+
if model._path is None:
|
|
211
|
+
raise ValueError(f"Unhandled model path for model {model_name}")
|
|
210
212
|
seed_filename = model._path.relative_to(input_paths.seeds)
|
|
211
213
|
|
|
212
214
|
# seed definition - rename "items.csv" -> "items.sql"
|
|
@@ -219,6 +221,8 @@ def _convert_models(
|
|
|
219
221
|
assert isinstance(model.kind, SeedKind)
|
|
220
222
|
model.kind.path = str(Path("../seeds", seed_filename))
|
|
221
223
|
else:
|
|
224
|
+
if model._path is None:
|
|
225
|
+
raise ValueError(f"Unhandled model path for model {model_name}")
|
|
222
226
|
if input_paths.models in model._path.parents:
|
|
223
227
|
model_filename = model._path.relative_to(input_paths.models)
|
|
224
228
|
elif input_paths.snapshots in model._path.parents:
|
|
@@ -290,6 +294,8 @@ def _convert_standalone_audits(
|
|
|
290
294
|
|
|
291
295
|
audit_definition_string = ";\n".join(stringified)
|
|
292
296
|
|
|
297
|
+
if audit._path is None:
|
|
298
|
+
continue
|
|
293
299
|
audit_filename = audit._path.relative_to(input_paths.tests)
|
|
294
300
|
audit_output_path = output_paths.audits / audit_filename
|
|
295
301
|
audit_output_path.write_text(audit_definition_string)
|
sqlmesh/lsp/reference.py
CHANGED
|
@@ -164,6 +164,9 @@ def get_model_definitions_for_a_path(
|
|
|
164
164
|
else:
|
|
165
165
|
return []
|
|
166
166
|
|
|
167
|
+
if file_path is None:
|
|
168
|
+
return []
|
|
169
|
+
|
|
167
170
|
# Find all possible references
|
|
168
171
|
references: t.List[Reference] = []
|
|
169
172
|
|
|
@@ -246,6 +249,8 @@ def get_model_definitions_for_a_path(
|
|
|
246
249
|
if referenced_model is None:
|
|
247
250
|
continue
|
|
248
251
|
referenced_model_path = referenced_model._path
|
|
252
|
+
if referenced_model_path is None:
|
|
253
|
+
continue
|
|
249
254
|
# Check whether the path exists
|
|
250
255
|
if not referenced_model_path.is_file():
|
|
251
256
|
continue
|
|
@@ -372,6 +377,9 @@ def get_macro_definitions_for_a_path(
|
|
|
372
377
|
else:
|
|
373
378
|
return []
|
|
374
379
|
|
|
380
|
+
if file_path is None:
|
|
381
|
+
return []
|
|
382
|
+
|
|
375
383
|
references = []
|
|
376
384
|
_, config_path = lsp_context.context.config_for_path(
|
|
377
385
|
file_path,
|
sqlmesh/magics.py
CHANGED
|
@@ -287,8 +287,9 @@ class SQLMeshMagics(Magics):
|
|
|
287
287
|
if loaded.name == args.model:
|
|
288
288
|
model = loaded
|
|
289
289
|
else:
|
|
290
|
-
|
|
291
|
-
|
|
290
|
+
if model._path:
|
|
291
|
+
with open(model._path, "r", encoding="utf-8") as file:
|
|
292
|
+
expressions = parse(file.read(), default_dialect=config.dialect)
|
|
292
293
|
|
|
293
294
|
formatted = format_model_expressions(
|
|
294
295
|
expressions,
|
|
@@ -307,8 +308,9 @@ class SQLMeshMagics(Magics):
|
|
|
307
308
|
replace=True,
|
|
308
309
|
)
|
|
309
310
|
|
|
310
|
-
|
|
311
|
-
|
|
311
|
+
if model._path:
|
|
312
|
+
with open(model._path, "w", encoding="utf-8") as file:
|
|
313
|
+
file.write(formatted)
|
|
312
314
|
|
|
313
315
|
if sql:
|
|
314
316
|
context.console.log_success(f"Model `{args.model}` updated")
|
|
@@ -1,6 +1,6 @@
|
|
|
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=3sW3IsgIqRv-yyS7RFt31EBonk0WMykh--mr6eY-8SE,530
|
|
3
|
+
sqlmesh/magics.py,sha256=tdkXrxkZug6LZ5F8TH4lx_XNV3T8bHGYTJUlGJfPQ4A,41777
|
|
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
|
|
@@ -13,17 +13,17 @@ sqlmesh/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
13
13
|
sqlmesh/core/_typing.py,sha256=e1f7xO2aZCy38M_3VoDy-XI3shyd99-IFctgIFSgXWM,497
|
|
14
14
|
sqlmesh/core/console.py,sha256=ObpdArJOXDOihWPXsWIUuwiQ64cMlroNWJHqQPkVqC0,160753
|
|
15
15
|
sqlmesh/core/constants.py,sha256=gUABXWYgH_XOSbaZAJsR5o1dmA61JDCvBDyxqqXX3LM,2630
|
|
16
|
-
sqlmesh/core/context.py,sha256=
|
|
16
|
+
sqlmesh/core/context.py,sha256=IKZxD5BnbwLKCRFt4s02W4HZ5REXFiOnyl6Ywhc3yA8,124456
|
|
17
17
|
sqlmesh/core/context_diff.py,sha256=CeUmMBJzN__98YohrtAiIYPIZI9mrGBk6bVADWBLUw8,21692
|
|
18
18
|
sqlmesh/core/dialect.py,sha256=1ykYwb9WZn_nCaX08PcQ0BJh2Pihv9SPvoMNjpMeCfs,50158
|
|
19
19
|
sqlmesh/core/environment.py,sha256=7DbJX0r5nZRU3LhcgIxbSV-JosQYDjAt3V5Wc2Fpns8,13005
|
|
20
20
|
sqlmesh/core/lineage.py,sha256=zjB0Zfamo2Fja2r5SSZPMbrEKTXr1WjozZPVqvxdybI,3143
|
|
21
21
|
sqlmesh/core/loader.py,sha256=Imb65SX5TtvQrtlilin2hkYg12gm9e9c30I8o95nkVE,40534
|
|
22
|
-
sqlmesh/core/macros.py,sha256=
|
|
23
|
-
sqlmesh/core/node.py,sha256=
|
|
22
|
+
sqlmesh/core/macros.py,sha256=ogIHo_Eh-Calty9NFuJ-QpfLNFBSauK738mg_srv4iM,60626
|
|
23
|
+
sqlmesh/core/node.py,sha256=3ChBz1PIMJhp-jzed_GLBrtmEF2v_BVDEM5WNe0ssPk,14658
|
|
24
24
|
sqlmesh/core/notification_target.py,sha256=PPGoDrgbRKxr27vJEu03XqNTQLYTw0ZF_b0yAapxGeI,16158
|
|
25
25
|
sqlmesh/core/reference.py,sha256=k7OSkLqTjPR8WJjNeFj0xAJ297nZUMgb_iTVwKRRKjc,4875
|
|
26
|
-
sqlmesh/core/renderer.py,sha256=
|
|
26
|
+
sqlmesh/core/renderer.py,sha256=SVE1THHK1UVdPPHjmqNbBVIjmEYcK8tz5pWh1ss8xGs,26684
|
|
27
27
|
sqlmesh/core/scheduler.py,sha256=5qSC-EHKotWpwFFvnwDHw3feYfz9c8_9gBGRfdeu8P4,40512
|
|
28
28
|
sqlmesh/core/schema_diff.py,sha256=Sp2MoqAngp-yTYevkLaf9jb26SuAdGXoZ54g5MjWowU,30516
|
|
29
29
|
sqlmesh/core/schema_loader.py,sha256=lvrI9k7hr1P4X4E6t3U-KrcuvdQuw0UdNlN90P2s52w,3563
|
|
@@ -88,7 +88,7 @@ sqlmesh/core/model/__init__.py,sha256=C8GRZ53xuXEA9hQv3BQS9pNNyd9rZ06R_B96UYGhDu
|
|
|
88
88
|
sqlmesh/core/model/cache.py,sha256=csun0RJguHzKX6-qITcOs4fVP4f8_Ts8qiUVV4sHY6Q,7869
|
|
89
89
|
sqlmesh/core/model/common.py,sha256=dPyqXLaDSnQgDVdbiOZ7YwomlaPIvGfyL-mHhc7bR1o,17830
|
|
90
90
|
sqlmesh/core/model/decorator.py,sha256=wUUg5t0K559tV9Pqt6FE2EWXt5TPGb4wF2Yg4B4hX4w,9251
|
|
91
|
-
sqlmesh/core/model/definition.py,sha256=
|
|
91
|
+
sqlmesh/core/model/definition.py,sha256=HivkFcm2f7UclH4j0oXd0qbJm919uFjkE3lfo-Smtd8,112780
|
|
92
92
|
sqlmesh/core/model/kind.py,sha256=8Dp8yiTiXltboZWrB2FJ-LQ3zx4Fv_5Tj0KdUIPwCHI,36358
|
|
93
93
|
sqlmesh/core/model/meta.py,sha256=D9InI9M2-IXeb34vkXNQSLALL8xVXjZ_LXwI-Tqxm7I,21197
|
|
94
94
|
sqlmesh/core/model/schema.py,sha256=_HMYfzK9wWXh7_CQDIIGnuQUD4aiX3o5D2cRp2sERzc,3387
|
|
@@ -102,7 +102,7 @@ sqlmesh/core/plan/stages.py,sha256=7iiVZLSRoI1kSEMyOuuW6gvUA-eyALUfdW5vDh_N4jU,2
|
|
|
102
102
|
sqlmesh/core/snapshot/__init__.py,sha256=Z5HTetNCZGoKF1WAKXk4LWL9dc8EC8lwS2O4TtoBmt4,1317
|
|
103
103
|
sqlmesh/core/snapshot/cache.py,sha256=bgqCR2hyf6r2A_8QP1EnXFK25gDX37-Zg0YeMuETWxg,3934
|
|
104
104
|
sqlmesh/core/snapshot/categorizer.py,sha256=qGG5870mu1jR2whKisSBH_GFbsyh96RnzJDgkN7DV9g,2482
|
|
105
|
-
sqlmesh/core/snapshot/definition.py,sha256=
|
|
105
|
+
sqlmesh/core/snapshot/definition.py,sha256=DwYTNcDfPQUQ1osF_63SdicSj7oqVjtmPPEzqwsxDLU,85748
|
|
106
106
|
sqlmesh/core/snapshot/evaluator.py,sha256=yNVxlTIV8_mKmUsIJtQtjT8RZHDHA64pUPds9VZfOq8,90503
|
|
107
107
|
sqlmesh/core/state_sync/__init__.py,sha256=B60xj-_Xk-4jas3UphLvwkuf04G-9AyGckcblXE0aRg,869
|
|
108
108
|
sqlmesh/core/state_sync/base.py,sha256=AdqWmbhnvRFqVcFK6L01uCvpBVAYGuMrm4P0D3u_NaU,18334
|
|
@@ -145,7 +145,7 @@ sqlmesh/dbt/util.py,sha256=BdtfQ7sxnZ8y8CFJStkePpmRE-KntHCXTefRnXR5Pag,905
|
|
|
145
145
|
sqlmesh/dbt/converter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
146
146
|
sqlmesh/dbt/converter/common.py,sha256=APynHIN5aeL1hyetIib67O-zRcae-Mw-QEQEihcMVpI,1454
|
|
147
147
|
sqlmesh/dbt/converter/console.py,sha256=yTl08JyM_KM-Ya8VIX-l0r1rOsaxkBboiz-BbsF7SMU,4610
|
|
148
|
-
sqlmesh/dbt/converter/convert.py,sha256=
|
|
148
|
+
sqlmesh/dbt/converter/convert.py,sha256=CX3faG6oLhhItqghQTkqqpo2LaUdu3sIAeaofA4eymM,15854
|
|
149
149
|
sqlmesh/dbt/converter/jinja.py,sha256=LwtMRWcVYv16cVilOekBjoFfnD-OBfaP90JpYy34jiw,25279
|
|
150
150
|
sqlmesh/dbt/converter/jinja_builtins.py,sha256=EVWyDNn0wnSrn9T5TkmKdBBVdw0TzROlfwnSVgnMehM,4589
|
|
151
151
|
sqlmesh/dbt/converter/jinja_transforms.py,sha256=MkgL3Wky2mHzLaEIqkCwiYQk99jL19Wt2pOoXhsqtqQ,17597
|
|
@@ -173,7 +173,7 @@ sqlmesh/lsp/description.py,sha256=PjguwyVw5YeYSgT0JMhkf5U1Jry-sDPLvQ2caIR9JPQ,85
|
|
|
173
173
|
sqlmesh/lsp/helpers.py,sha256=EFc1u3-b7kSv5-tNwmKUDxId72RCLDBnN2lLTgRSzzQ,1020
|
|
174
174
|
sqlmesh/lsp/hints.py,sha256=j-blccBUil94yRoDjWfkSM0HqMmsKD6hP2TaWdWWVk4,3734
|
|
175
175
|
sqlmesh/lsp/main.py,sha256=TRuegZaC04cPDThtmz_zL6YqBpQz342brv1luIbDTZ8,38186
|
|
176
|
-
sqlmesh/lsp/reference.py,sha256=
|
|
176
|
+
sqlmesh/lsp/reference.py,sha256=CjIXCJ5qM5mHyKRyM1brKyvpK9oQfLI0LiNKHfjJuVw,32257
|
|
177
177
|
sqlmesh/lsp/rename.py,sha256=399v1vyVRHHxvbCHVcuS4Pl8K2N-Z60JdZ6e1znOI4s,4397
|
|
178
178
|
sqlmesh/lsp/uri.py,sha256=mvSLbZGmMTHPpliThOtVWiFcHnfJzp1w39q9l-xD2SI,802
|
|
179
179
|
sqlmesh/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -284,7 +284,7 @@ sqlmesh/utils/pydantic.py,sha256=o_NsXbIpDqNpUA1Uc5xF0ZzoXQYYB0DfHwdRxBwXPNk,120
|
|
|
284
284
|
sqlmesh/utils/rich.py,sha256=BpB47G0-JcU41LkGkeGKroexj4NOV5fox4-GOIXPgIc,3545
|
|
285
285
|
sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
|
|
286
286
|
sqlmesh/utils/yaml.py,sha256=hvo5lmybYLcIx4p6CQwufS8X4MbwS60lEBnCmYJCXmU,2336
|
|
287
|
-
sqlmesh-0.199.1.
|
|
287
|
+
sqlmesh-0.199.1.dev34.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
|
|
288
288
|
web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
289
289
|
web/client/dist/index.html,sha256=DAv6ABGogw4xRLb0T_92WP_S7XWyqVhwBgGKWtuQwU4,5472
|
|
290
290
|
web/client/dist/assets/Audits-BuHAmFO8.js,sha256=zbYUF6WdUGMbnMm01GMNPb7xAJwj-o5wMdL56vPo2qE,1041
|
|
@@ -384,9 +384,9 @@ web/server/app.py,sha256=b6qEJ4btjaSm2kWwQUGV--S3VE8QW0Um7f4rBdaoB_M,59
|
|
|
384
384
|
web/server/console.py,sha256=CJlhoNBVUj_U5h_88gQgDJNzLOe2FAQ1DcFeMdO3H18,14583
|
|
385
385
|
web/server/exceptions.py,sha256=I2PPpChwhDWawQENr5kHg6DjyRGeiJ6OWZsCzEZhVzs,1533
|
|
386
386
|
web/server/main.py,sha256=9PaDa8sigo1z0AxtI3sQ3fHmDqs6uXwP-_IvoMwkznw,3199
|
|
387
|
-
web/server/models.py,sha256=
|
|
387
|
+
web/server/models.py,sha256=EzMxPLz_igDBZ3tMlI7niylVih_Hh7YITZAK3c8sOiA,15556
|
|
388
388
|
web/server/openapi.py,sha256=NOg__YQg7arVdajQv5CvOA5KLTQCfGZFvwnjARuM6iE,586
|
|
389
|
-
web/server/settings.py,sha256=
|
|
389
|
+
web/server/settings.py,sha256=_W50-Holci5Zv8goK7qATLRD1_Fcx-75gcNTVjdGDOc,3770
|
|
390
390
|
web/server/utils.py,sha256=bb6AOM3Nga-zihPjZvJeDL6sHqTPNC_SYjklsy8tAQA,4013
|
|
391
391
|
web/server/watcher.py,sha256=2c08EfXkgAfqpAEoFidkYjGH48DkLDyMueVp4afICHM,5334
|
|
392
392
|
web/server/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -398,12 +398,12 @@ web/server/api/endpoints/events.py,sha256=tjhOhGe9jt7L1mOLLapl5qTvicDRnP5lPZHSq9
|
|
|
398
398
|
web/server/api/endpoints/files.py,sha256=Rr0YS9Nz9vLH9KvGAfxbMlxN8j1XxU9CViFvlKoP2YQ,6747
|
|
399
399
|
web/server/api/endpoints/lineage.py,sha256=XU99RI-6Q9SidItGM5WLQMje8NhM5nZWHbtWxDwWeFE,6050
|
|
400
400
|
web/server/api/endpoints/meta.py,sha256=QKWWrHewGh5JS8mCSWXTKCIQwXw-TQfaT9tWt_SsNY4,1032
|
|
401
|
-
web/server/api/endpoints/models.py,sha256=
|
|
401
|
+
web/server/api/endpoints/models.py,sha256=kwj0s7uve3iZSMfmjkoPVMFMeY1sD0peTeyrWfzI0kI,4742
|
|
402
402
|
web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
|
|
403
403
|
web/server/api/endpoints/plan.py,sha256=bbbY50W_2MsZSTxOHWMKz0tbIm75nsRSlPy8GI2fg9Q,9306
|
|
404
404
|
web/server/api/endpoints/table_diff.py,sha256=SCy3-pr5x6bEEiOaZGCDbiHQhpgxwmnz3Acqa2Ie6jI,2090
|
|
405
|
-
sqlmesh-0.199.1.
|
|
406
|
-
sqlmesh-0.199.1.
|
|
407
|
-
sqlmesh-0.199.1.
|
|
408
|
-
sqlmesh-0.199.1.
|
|
409
|
-
sqlmesh-0.199.1.
|
|
405
|
+
sqlmesh-0.199.1.dev34.dist-info/METADATA,sha256=q_vQrhtmnSFSZk0NLlSXgPVsNk_om42U68wH4ejEOkk,26659
|
|
406
|
+
sqlmesh-0.199.1.dev34.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
407
|
+
sqlmesh-0.199.1.dev34.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
408
|
+
sqlmesh-0.199.1.dev34.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
409
|
+
sqlmesh-0.199.1.dev34.dist-info/RECORD,,
|
|
@@ -121,11 +121,12 @@ def serialize_model(context: Context, model: Model, render_query: bool = False)
|
|
|
121
121
|
)
|
|
122
122
|
sql = query.sql(pretty=True, dialect=model.dialect)
|
|
123
123
|
|
|
124
|
+
path = model._path
|
|
124
125
|
return models.Model(
|
|
125
126
|
name=model.name,
|
|
126
127
|
fqn=model.fqn,
|
|
127
|
-
path=str(
|
|
128
|
-
full_path=str(
|
|
128
|
+
path=str(path.absolute().relative_to(context.path).as_posix()) if path else None,
|
|
129
|
+
full_path=str(path.absolute().as_posix()) if path else None,
|
|
129
130
|
dialect=dialect,
|
|
130
131
|
columns=columns,
|
|
131
132
|
details=details,
|
web/server/models.py
CHANGED
|
@@ -171,8 +171,8 @@ class Column(PydanticModel):
|
|
|
171
171
|
class Model(PydanticModel):
|
|
172
172
|
name: str
|
|
173
173
|
fqn: str
|
|
174
|
-
path: str
|
|
175
|
-
full_path: str
|
|
174
|
+
path: t.Optional[str] = None
|
|
175
|
+
full_path: t.Optional[str] = None
|
|
176
176
|
"""
|
|
177
177
|
As opposed to path, which is relative to the project root, full_path is the absolute path to the model file.
|
|
178
178
|
"""
|
web/server/settings.py
CHANGED
|
@@ -80,7 +80,7 @@ def _get_loaded_context(path: str | Path, config: str, gateway: str) -> Context:
|
|
|
80
80
|
|
|
81
81
|
@lru_cache()
|
|
82
82
|
def _get_path_to_model_mapping(context: Context) -> dict[Path, Model]:
|
|
83
|
-
return {model._path: model for model in context._models.values()}
|
|
83
|
+
return {model._path: model for model in context._models.values() if model._path}
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
def get_path_to_model_mapping(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|