sqlmesh 0.188.2.dev7__py3-none-any.whl → 0.188.2.dev8__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.188.2.dev7'
21
- __version_tuple__ = version_tuple = (0, 188, 2, 'dev7')
20
+ __version__ = version = '0.188.2.dev8'
21
+ __version_tuple__ = version_tuple = (0, 188, 2, 'dev8')
sqlmesh/lsp/context.py CHANGED
@@ -5,7 +5,7 @@ import typing as t
5
5
 
6
6
  from sqlmesh.core.model.definition import SqlModel
7
7
  from sqlmesh.core.linter.definition import AnnotatedRuleViolation
8
- from sqlmesh.lsp.custom import RenderModelEntry
8
+ from sqlmesh.lsp.custom import RenderModelEntry, ModelForRendering
9
9
  from sqlmesh.lsp.uri import URI
10
10
 
11
11
 
@@ -148,3 +148,29 @@ class LSPContext:
148
148
  # Store in cache
149
149
  self._lint_cache[path] = diagnostics
150
150
  return diagnostics
151
+
152
+ def list_of_models_for_rendering(self) -> t.List[ModelForRendering]:
153
+ """Get a list of models for rendering.
154
+
155
+ Returns:
156
+ List of ModelForRendering objects.
157
+ """
158
+ return [
159
+ ModelForRendering(
160
+ name=model.name,
161
+ fqn=model.fqn,
162
+ description=model.description,
163
+ uri=URI.from_path(model._path).value,
164
+ )
165
+ for model in self.context.models.values()
166
+ if isinstance(model, SqlModel) and model._path is not None
167
+ ] + [
168
+ ModelForRendering(
169
+ name=audit.name,
170
+ fqn=audit.fqn,
171
+ description=audit.description,
172
+ uri=URI.from_path(audit._path).value,
173
+ )
174
+ for audit in self.context.standalone_audits.values()
175
+ if audit._path is not None
176
+ ]
sqlmesh/lsp/custom.py CHANGED
@@ -46,3 +46,29 @@ class RenderModelResponse(PydanticModel):
46
46
  """
47
47
 
48
48
  models: t.List[RenderModelEntry]
49
+
50
+
51
+ ALL_MODELS_FOR_RENDER_FEATURE = "sqlmesh/all_models_for_render"
52
+
53
+
54
+ class ModelForRendering(PydanticModel):
55
+ """
56
+ A model that is available for rendering.
57
+ """
58
+
59
+ name: str
60
+ fqn: str
61
+ description: t.Optional[str] = None
62
+ uri: str
63
+
64
+
65
+ class AllModelsForRenderRequest(PydanticModel):
66
+ pass
67
+
68
+
69
+ class AllModelsForRenderResponse(PydanticModel):
70
+ """
71
+ Response to get all the models that are in the current project for rendering purposes.
72
+ """
73
+
74
+ models: t.List[ModelForRendering]
sqlmesh/lsp/main.py CHANGED
@@ -27,9 +27,12 @@ from sqlmesh.lsp.context import (
27
27
  )
28
28
  from sqlmesh.lsp.custom import (
29
29
  ALL_MODELS_FEATURE,
30
+ ALL_MODELS_FOR_RENDER_FEATURE,
30
31
  RENDER_MODEL_FEATURE,
31
32
  AllModelsRequest,
32
33
  AllModelsResponse,
34
+ AllModelsForRenderRequest,
35
+ AllModelsForRenderResponse,
33
36
  RenderModelRequest,
34
37
  RenderModelResponse,
35
38
  )
@@ -122,6 +125,19 @@ class SQLMeshLanguageServer:
122
125
  context = self._context_get_or_load(uri)
123
126
  return RenderModelResponse(models=context.render_model(uri))
124
127
 
128
+ @self.server.feature(ALL_MODELS_FOR_RENDER_FEATURE)
129
+ def all_models_for_render(
130
+ ls: LanguageServer, params: AllModelsForRenderRequest
131
+ ) -> AllModelsForRenderResponse:
132
+ if self.lsp_context is None:
133
+ current_path = Path.cwd()
134
+ self._ensure_context_in_folder(current_path)
135
+ if self.lsp_context is None:
136
+ raise RuntimeError("No context found")
137
+ return AllModelsForRenderResponse(
138
+ models=self.lsp_context.list_of_models_for_rendering()
139
+ )
140
+
125
141
  @self.server.feature(API_FEATURE)
126
142
  def api(ls: LanguageServer, request: ApiRequest) -> t.Dict[str, t.Any]:
127
143
  ls.log_trace(f"API request: {request}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlmesh
3
- Version: 0.188.2.dev7
3
+ Version: 0.188.2.dev8
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=69xw6bTmi4cW90M-sl3g6wLDgxVcLHcKg1q8GS3lqyA,7466
2
- sqlmesh/_version.py,sha256=gh4buyj4JrUosh_TPs6jJKlPBFisvoRIsNwj4vpqPek,528
2
+ sqlmesh/_version.py,sha256=dEGIr2rTdZSwif_uyGGis0ZKXRunTZhHS9JYt99DtoM,528
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
@@ -157,10 +157,10 @@ sqlmesh/integrations/github/cicd/config.py,sha256=tRhMZaLf1p6AWXvi67n85Q-lptJNGt
157
157
  sqlmesh/integrations/github/cicd/controller.py,sha256=FmOO93RF5auSU6aDU2beiP5LblLs38eAUYgHGWB9jYc,41666
158
158
  sqlmesh/lsp/api.py,sha256=LJdECSaEZoPbu_Xl4KscVG-WLt7_g4dY-zKGO68dH14,2162
159
159
  sqlmesh/lsp/completions.py,sha256=Uo8lUzPBeoB58Eu2642YoAtNI0pgIFWFSvwmuJALTv4,3583
160
- sqlmesh/lsp/context.py,sha256=mqxUn_RuTZZwmRw6Axi4roUQNMDS5zv6a5X595A6Enc,4764
161
- sqlmesh/lsp/custom.py,sha256=7VPBK8E6w3KFsYxjiQgpdPkSBGzT69HfPvnS3wYpWNo,920
160
+ sqlmesh/lsp/context.py,sha256=JkHV7Du2V_GPws8EYd6MpLeVwr1w40rQMNFczRI1fkA,5671
161
+ sqlmesh/lsp/custom.py,sha256=Mml6V1nYAHdP4Zt8gxly1ZLKYALtxGeAVzPrrYpc7m8,1426
162
162
  sqlmesh/lsp/description.py,sha256=4QIGC9ix8IzmWF6DVUNhY4m1Crk3sNQA6hZ1RbyqU78,827
163
- sqlmesh/lsp/main.py,sha256=yCy4Hz_0Cqe-QGOb0oCHUNUCwPGY4yIEyO--UgB5y8g,28211
163
+ sqlmesh/lsp/main.py,sha256=TmFJbuLQ_CzQ0EuhKmqQK3F16tOpC_kYIAck2hDqd_s,28884
164
164
  sqlmesh/lsp/reference.py,sha256=-HkMMzRzq4ike5mSkoWajanYNMAwhQhlPaqw62451ac,16887
165
165
  sqlmesh/lsp/uri.py,sha256=mvSLbZGmMTHPpliThOtVWiFcHnfJzp1w39q9l-xD2SI,802
166
166
  sqlmesh/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -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.dev7.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
273
+ sqlmesh-0.188.2.dev8.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=U9DgO3KqjoSuGiKVKR8AAdfXFUa0kaXJgIRAsmZ5RH8,5472
276
276
  web/client/dist/assets/Audits-CNkn30Bu.js,sha256=0uC1ibXDFzBjPRshILFo9VzNNKHT3nvIgQhrhVDG-1Y,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.dev7.dist-info/METADATA,sha256=I0HuoWQXgOWJhmY5OT-OL49CB4scKiIBzky8qhBELws,26531
392
- sqlmesh-0.188.2.dev7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
393
- sqlmesh-0.188.2.dev7.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
394
- sqlmesh-0.188.2.dev7.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
395
- sqlmesh-0.188.2.dev7.dist-info/RECORD,,
391
+ sqlmesh-0.188.2.dev8.dist-info/METADATA,sha256=ogC8NwLRUs9_SWHA-p7CzN5C11edh45swAhZeLS78-0,26531
392
+ sqlmesh-0.188.2.dev8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
393
+ sqlmesh-0.188.2.dev8.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
394
+ sqlmesh-0.188.2.dev8.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
395
+ sqlmesh-0.188.2.dev8.dist-info/RECORD,,