sqlmesh 0.204.1.dev5__py3-none-any.whl → 0.204.1.dev6__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 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.204.1.dev5'
21
- __version_tuple__ = version_tuple = (0, 204, 1, 'dev5')
20
+ __version__ = version = '0.204.1.dev6'
21
+ __version_tuple__ = version_tuple = (0, 204, 1, 'dev6')
sqlmesh/lsp/main.py CHANGED
@@ -496,10 +496,10 @@ class SQLMeshLanguageServer:
496
496
  target_range = reference.target_range
497
497
  target_selection_range = reference.target_range
498
498
 
499
- if reference.uri is not None:
499
+ if reference.path is not None:
500
500
  location_links.append(
501
501
  types.LocationLink(
502
- target_uri=reference.uri,
502
+ target_uri=URI.from_path(reference.path).value,
503
503
  target_selection_range=target_selection_range,
504
504
  target_range=target_range,
505
505
  origin_selection_range=reference.range,
@@ -523,9 +523,9 @@ class SQLMeshLanguageServer:
523
523
 
524
524
  # Convert references to Location objects
525
525
  locations = [
526
- types.Location(uri=ref.uri, range=ref.range)
526
+ types.Location(uri=URI.from_path(ref.path).value, range=ref.range)
527
527
  for ref in all_references
528
- if ref.uri is not None
528
+ if ref.path is not None
529
529
  ]
530
530
 
531
531
  return locations if locations else None
sqlmesh/lsp/reference.py CHANGED
@@ -29,7 +29,7 @@ class LSPModelReference(PydanticModel):
29
29
  """A LSP reference to a model, excluding external models."""
30
30
 
31
31
  type: t.Literal["model"] = "model"
32
- uri: str
32
+ path: Path
33
33
  range: Range
34
34
  markdown_description: t.Optional[str] = None
35
35
 
@@ -40,9 +40,9 @@ class LSPExternalModelReference(PydanticModel):
40
40
  type: t.Literal["external_model"] = "external_model"
41
41
  range: Range
42
42
  target_range: t.Optional[Range] = None
43
- uri: t.Optional[str] = None
44
- """The URI of the external model, typically a YAML file, it is optional because
45
- external models can be unregistered and so they URI is not available."""
43
+ path: t.Optional[Path] = None
44
+ """The path of the external model, typically a YAML file, it is optional because
45
+ external models can be unregistered and so the path is not available."""
46
46
 
47
47
  markdown_description: t.Optional[str] = None
48
48
 
@@ -51,7 +51,7 @@ class LSPCteReference(PydanticModel):
51
51
  """A LSP reference to a CTE."""
52
52
 
53
53
  type: t.Literal["cte"] = "cte"
54
- uri: str
54
+ path: Path
55
55
  range: Range
56
56
  target_range: Range
57
57
 
@@ -60,7 +60,7 @@ class LSPMacroReference(PydanticModel):
60
60
  """A LSP reference to a macro."""
61
61
 
62
62
  type: t.Literal["macro"] = "macro"
63
- uri: str
63
+ path: Path
64
64
  range: Range
65
65
  target_range: Range
66
66
  markdown_description: t.Optional[str] = None
@@ -209,7 +209,7 @@ def get_model_definitions_for_a_path(
209
209
 
210
210
  references.append(
211
211
  LSPCteReference(
212
- uri=document_uri.value, # Same file
212
+ path=document_uri.to_path(), # Same file
213
213
  range=table_range,
214
214
  target_range=target_range,
215
215
  )
@@ -219,7 +219,7 @@ def get_model_definitions_for_a_path(
219
219
  scope=scope,
220
220
  reference_name=table.name,
221
221
  read_file=read_file,
222
- referenced_model_uri=document_uri,
222
+ referenced_model_path=document_uri.to_path(),
223
223
  description="",
224
224
  reference_type="cte",
225
225
  cte_target_range=target_range,
@@ -270,7 +270,6 @@ def get_model_definitions_for_a_path(
270
270
  # Check whether the path exists
271
271
  if not referenced_model_path.is_file():
272
272
  continue
273
- referenced_model_uri = URI.from_path(referenced_model_path)
274
273
 
275
274
  # Extract metadata for positioning
276
275
  table_meta = TokenPositionDetails.from_meta(table.this.meta)
@@ -299,7 +298,7 @@ def get_model_definitions_for_a_path(
299
298
  )
300
299
  references.append(
301
300
  LSPExternalModelReference(
302
- uri=referenced_model_uri.value,
301
+ path=referenced_model_path,
303
302
  range=Range(
304
303
  start=to_lsp_position(start_pos_sqlmesh),
305
304
  end=to_lsp_position(end_pos_sqlmesh),
@@ -313,7 +312,7 @@ def get_model_definitions_for_a_path(
313
312
  scope=scope,
314
313
  reference_name=normalized_reference_name,
315
314
  read_file=read_file,
316
- referenced_model_uri=referenced_model_uri,
315
+ referenced_model_path=referenced_model_path,
317
316
  description=description,
318
317
  yaml_target_range=yaml_target_range,
319
318
  reference_type="external_model",
@@ -324,7 +323,7 @@ def get_model_definitions_for_a_path(
324
323
  else:
325
324
  references.append(
326
325
  LSPModelReference(
327
- uri=referenced_model_uri.value,
326
+ path=referenced_model_path,
328
327
  range=Range(
329
328
  start=to_lsp_position(start_pos_sqlmesh),
330
329
  end=to_lsp_position(end_pos_sqlmesh),
@@ -337,7 +336,7 @@ def get_model_definitions_for_a_path(
337
336
  scope=scope,
338
337
  reference_name=normalized_reference_name,
339
338
  read_file=read_file,
340
- referenced_model_uri=referenced_model_uri,
339
+ referenced_model_path=referenced_model_path,
341
340
  description=description,
342
341
  reference_type="model",
343
342
  default_catalog=lint_context.context.default_catalog,
@@ -481,10 +480,9 @@ def get_macro_reference(
481
480
  return None
482
481
 
483
482
  # Create a reference to the macro definition
484
- macro_uri = URI.from_path(path)
485
483
 
486
484
  return LSPMacroReference(
487
- uri=macro_uri.value,
485
+ path=path,
488
486
  range=to_lsp_range(macro_range),
489
487
  target_range=Range(
490
488
  start=Position(line=start_line - 1, character=0),
@@ -517,7 +515,7 @@ def get_built_in_macro_reference(macro_name: str, macro_range: Range) -> t.Optio
517
515
  end_line_number = line_number + len(source_lines) - 1
518
516
 
519
517
  return LSPMacroReference(
520
- uri=URI.from_path(Path(filename)).value,
518
+ path=Path(filename),
521
519
  range=macro_range,
522
520
  target_range=Range(
523
521
  start=Position(line=line_number - 1, character=0),
@@ -559,12 +557,12 @@ def get_model_find_all_references(
559
557
 
560
558
  assert isinstance(model_at_position, LSPModelReference) # for mypy
561
559
 
562
- target_model_uri = model_at_position.uri
560
+ target_model_path = model_at_position.path
563
561
 
564
562
  # Start with the model definition
565
563
  all_references: t.List[LSPModelReference] = [
566
564
  LSPModelReference(
567
- uri=model_at_position.uri,
565
+ path=model_at_position.path,
568
566
  range=Range(
569
567
  start=Position(line=0, character=0),
570
568
  end=Position(line=0, character=0),
@@ -575,7 +573,7 @@ def get_model_find_all_references(
575
573
 
576
574
  # Then add references from the current file
577
575
  current_file_refs = filter(
578
- lambda ref: isinstance(ref, LSPModelReference) and ref.uri == target_model_uri,
576
+ lambda ref: isinstance(ref, LSPModelReference) and ref.path == target_model_path,
579
577
  get_model_definitions_for_a_path(lint_context, document_uri),
580
578
  )
581
579
 
@@ -584,7 +582,7 @@ def get_model_find_all_references(
584
582
 
585
583
  all_references.append(
586
584
  LSPModelReference(
587
- uri=document_uri.value,
585
+ path=document_uri.to_path(),
588
586
  range=ref.range,
589
587
  markdown_description=ref.markdown_description,
590
588
  )
@@ -600,7 +598,7 @@ def get_model_find_all_references(
600
598
 
601
599
  # Get model references that point to the target model
602
600
  matching_refs = filter(
603
- lambda ref: isinstance(ref, LSPModelReference) and ref.uri == target_model_uri,
601
+ lambda ref: isinstance(ref, LSPModelReference) and ref.path == target_model_path,
604
602
  get_model_definitions_for_a_path(lint_context, file_uri),
605
603
  )
606
604
 
@@ -609,7 +607,7 @@ def get_model_find_all_references(
609
607
 
610
608
  all_references.append(
611
609
  LSPModelReference(
612
- uri=file_uri.value,
610
+ path=path,
613
611
  range=ref.range,
614
612
  markdown_description=ref.markdown_description,
615
613
  )
@@ -662,7 +660,7 @@ def get_cte_references(
662
660
  # Add the CTE definition
663
661
  matching_references = [
664
662
  LSPCteReference(
665
- uri=document_uri.value,
663
+ path=document_uri.to_path(),
666
664
  range=target_cte_definition_range,
667
665
  target_range=target_cte_definition_range,
668
666
  )
@@ -673,7 +671,7 @@ def get_cte_references(
673
671
  if ref.target_range == target_cte_definition_range:
674
672
  matching_references.append(
675
673
  LSPCteReference(
676
- uri=document_uri.value,
674
+ path=document_uri.to_path(),
677
675
  range=ref.range,
678
676
  target_range=ref.target_range,
679
677
  )
@@ -713,13 +711,13 @@ def get_macro_find_all_references(
713
711
 
714
712
  assert isinstance(macro_at_position, LSPMacroReference) # for mypy
715
713
 
716
- target_macro_uri = macro_at_position.uri
714
+ target_macro_path = macro_at_position.path
717
715
  target_macro_target_range = macro_at_position.target_range
718
716
 
719
717
  # Start with the macro definition
720
718
  all_references: t.List[LSPMacroReference] = [
721
719
  LSPMacroReference(
722
- uri=target_macro_uri,
720
+ path=target_macro_path,
723
721
  range=target_macro_target_range,
724
722
  target_range=target_macro_target_range,
725
723
  markdown_description=None,
@@ -733,7 +731,7 @@ def get_macro_find_all_references(
733
731
  # Get macro references that point to the same macro definition
734
732
  matching_refs = filter(
735
733
  lambda ref: isinstance(ref, LSPMacroReference)
736
- and ref.uri == target_macro_uri
734
+ and ref.path == target_macro_path
737
735
  and ref.target_range == target_macro_target_range,
738
736
  get_macro_definitions_for_a_path(lsp_context, file_uri),
739
737
  )
@@ -742,7 +740,7 @@ def get_macro_find_all_references(
742
740
  assert isinstance(ref, LSPMacroReference) # for mypy
743
741
  all_references.append(
744
742
  LSPMacroReference(
745
- uri=file_uri.value,
743
+ path=path,
746
744
  range=ref.range,
747
745
  target_range=ref.target_range,
748
746
  markdown_description=ref.markdown_description,
@@ -822,7 +820,7 @@ def _process_column_references(
822
820
  scope: t.Any,
823
821
  reference_name: str,
824
822
  read_file: t.List[str],
825
- referenced_model_uri: URI,
823
+ referenced_model_path: Path,
826
824
  description: t.Optional[str] = None,
827
825
  yaml_target_range: t.Optional[Range] = None,
828
826
  reference_type: t.Literal["model", "external_model", "cte"] = "model",
@@ -837,7 +835,7 @@ def _process_column_references(
837
835
  scope: The SQL scope to search for columns
838
836
  reference_name: The full reference name (may include database/catalog)
839
837
  read_file: The file content as list of lines
840
- referenced_model_uri: URI of the referenced model
838
+ referenced_model_path: Path of the referenced model
841
839
  description: Markdown description for the reference
842
840
  yaml_target_range: Target range for external models (YAML files)
843
841
  reference_type: Type of reference - "model", "external_model", or "cte"
@@ -857,7 +855,7 @@ def _process_column_references(
857
855
  table_range = _get_column_table_range(column, read_file)
858
856
  references.append(
859
857
  LSPCteReference(
860
- uri=referenced_model_uri.value,
858
+ path=referenced_model_path,
861
859
  range=table_range,
862
860
  target_range=cte_target_range,
863
861
  )
@@ -875,7 +873,7 @@ def _process_column_references(
875
873
  if reference_type == "external_model":
876
874
  references.append(
877
875
  LSPExternalModelReference(
878
- uri=referenced_model_uri.value,
876
+ path=referenced_model_path,
879
877
  range=table_range,
880
878
  markdown_description=description,
881
879
  target_range=yaml_target_range,
@@ -884,7 +882,7 @@ def _process_column_references(
884
882
  else:
885
883
  references.append(
886
884
  LSPModelReference(
887
- uri=referenced_model_uri.value,
885
+ path=referenced_model_path,
888
886
  range=table_range,
889
887
  markdown_description=description,
890
888
  )
sqlmesh/lsp/rename.py CHANGED
@@ -90,7 +90,7 @@ def _rename_cte(cte_references: t.List[LSPCteReference], new_name: str) -> Works
90
90
  changes: t.Dict[str, t.List[TextEdit]] = {}
91
91
 
92
92
  for ref in cte_references:
93
- uri = ref.uri
93
+ uri = URI.from_path(ref.path).value
94
94
  if uri not in changes:
95
95
  changes[uri] = []
96
96
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlmesh
3
- Version: 0.204.1.dev5
3
+ Version: 0.204.1.dev6
4
4
  Summary: Next-generation data transformation framework
5
5
  Author-email: "TobikoData Inc." <engineering@tobikodata.com>
6
6
  License: Apache License
@@ -1,5 +1,5 @@
1
1
  sqlmesh/__init__.py,sha256=QjwaamJIdW7voXoS880yAx7tHm-Im4_mqGA-XJgafos,7631
2
- sqlmesh/_version.py,sha256=fbJau8MH7oiDWFftxCnpgfHAJg9fGWsPwbB-3cOj1OI,528
2
+ sqlmesh/_version.py,sha256=z2bst6lZyy7YghpZT31C7nMoI32K7ixUo99WvUC7v3Q,528
3
3
  sqlmesh/magics.py,sha256=bEzYqXHcM0P3CjyUZ1O9arlmXAdLAhoglKbQ29fD9AE,41842
4
4
  sqlmesh/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  sqlmesh/cicd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -171,9 +171,9 @@ sqlmesh/lsp/description.py,sha256=PjguwyVw5YeYSgT0JMhkf5U1Jry-sDPLvQ2caIR9JPQ,85
171
171
  sqlmesh/lsp/errors.py,sha256=3NMim_5J00Eypz7t8b7XbkBfy8gIsRkeq-VcjD4COtc,1489
172
172
  sqlmesh/lsp/helpers.py,sha256=EFc1u3-b7kSv5-tNwmKUDxId72RCLDBnN2lLTgRSzzQ,1020
173
173
  sqlmesh/lsp/hints.py,sha256=j-blccBUil94yRoDjWfkSM0HqMmsKD6hP2TaWdWWVk4,3734
174
- sqlmesh/lsp/main.py,sha256=ZOcANYSo9_1tanuRyvpNrE43DpHTyCsYmOEWWJFFa0o,39964
175
- sqlmesh/lsp/reference.py,sha256=YFg0DwwCcr7A99ZJV69V1H3oYmEw4uRFrhhAYR3SJYw,33160
176
- sqlmesh/lsp/rename.py,sha256=399v1vyVRHHxvbCHVcuS4Pl8K2N-Z60JdZ6e1znOI4s,4397
174
+ sqlmesh/lsp/main.py,sha256=lTFXCaqSxJOS2ftGuvx65d4whgJV0iz25vtkB3Qt3kI,40010
175
+ sqlmesh/lsp/reference.py,sha256=PD9lfihjQIN9pmllzEWL2qXtZtvktAL8_ybmPJ-8W-I,33038
176
+ sqlmesh/lsp/rename.py,sha256=OwZsgEqK5sQkHXEx2SwINxquGF92xkHZ9nQLl7SqUiY,4419
177
177
  sqlmesh/lsp/uri.py,sha256=mvSLbZGmMTHPpliThOtVWiFcHnfJzp1w39q9l-xD2SI,802
178
178
  sqlmesh/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
179
179
  sqlmesh/migrations/v0001_init.py,sha256=h8FwMYJj9_O8yGpk12guaSaGwX5A3we2GiKeHrXi15o,2048
@@ -285,7 +285,7 @@ sqlmesh/utils/pydantic.py,sha256=o_NsXbIpDqNpUA1Uc5xF0ZzoXQYYB0DfHwdRxBwXPNk,120
285
285
  sqlmesh/utils/rich.py,sha256=cwQ5nJ6sgz64xHtoh6_ec7ReV5YpsOGhMtUJnwoRfEI,3549
286
286
  sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
287
287
  sqlmesh/utils/yaml.py,sha256=hvo5lmybYLcIx4p6CQwufS8X4MbwS60lEBnCmYJCXmU,2336
288
- sqlmesh-0.204.1.dev5.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
288
+ sqlmesh-0.204.1.dev6.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
289
289
  web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
290
290
  web/client/dist/index.html,sha256=SXykdSRNgrT1k6I2dPZPEfpxPjIsi8-yVFijt-naSA4,5472
291
291
  web/client/dist/assets/Audits-Jm353fhk.js,sha256=ry6b5IKT3hLAfD5C3T2BqxulfauEV0n0YZ2vsP4eQ_U,1041
@@ -403,8 +403,8 @@ web/server/api/endpoints/models.py,sha256=kwj0s7uve3iZSMfmjkoPVMFMeY1sD0peTeyrWf
403
403
  web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
404
404
  web/server/api/endpoints/plan.py,sha256=bbbY50W_2MsZSTxOHWMKz0tbIm75nsRSlPy8GI2fg9Q,9306
405
405
  web/server/api/endpoints/table_diff.py,sha256=SCy3-pr5x6bEEiOaZGCDbiHQhpgxwmnz3Acqa2Ie6jI,2090
406
- sqlmesh-0.204.1.dev5.dist-info/METADATA,sha256=sT5HaOw1myp03lnPj5gp0knBV7Qyj2_LJiFCiac5hdE,26678
407
- sqlmesh-0.204.1.dev5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
408
- sqlmesh-0.204.1.dev5.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
409
- sqlmesh-0.204.1.dev5.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
410
- sqlmesh-0.204.1.dev5.dist-info/RECORD,,
406
+ sqlmesh-0.204.1.dev6.dist-info/METADATA,sha256=OwTowzEaVG2PoyaqSaW0u7YDPOP8Pka8vfovlN6Qzh0,26678
407
+ sqlmesh-0.204.1.dev6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
408
+ sqlmesh-0.204.1.dev6.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
409
+ sqlmesh-0.204.1.dev6.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
410
+ sqlmesh-0.204.1.dev6.dist-info/RECORD,,