sqlmesh 0.186.2.dev4__py3-none-any.whl → 0.186.2.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 +2 -2
- sqlmesh/core/config/root.py +6 -2
- sqlmesh/lsp/description.py +30 -0
- sqlmesh/lsp/main.py +3 -2
- sqlmesh/lsp/reference.py +6 -3
- {sqlmesh-0.186.2.dev4.dist-info → sqlmesh-0.186.2.dev6.dist-info}/METADATA +1 -1
- {sqlmesh-0.186.2.dev4.dist-info → sqlmesh-0.186.2.dev6.dist-info}/RECORD +11 -10
- {sqlmesh-0.186.2.dev4.dist-info → sqlmesh-0.186.2.dev6.dist-info}/WHEEL +0 -0
- {sqlmesh-0.186.2.dev4.dist-info → sqlmesh-0.186.2.dev6.dist-info}/entry_points.txt +0 -0
- {sqlmesh-0.186.2.dev4.dist-info → sqlmesh-0.186.2.dev6.dist-info}/licenses/LICENSE +0 -0
- {sqlmesh-0.186.2.dev4.dist-info → sqlmesh-0.186.2.dev6.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.186.2.
|
|
21
|
-
__version_tuple__ = version_tuple = (0, 186, 2, '
|
|
20
|
+
__version__ = version = '0.186.2.dev6'
|
|
21
|
+
__version_tuple__ = version_tuple = (0, 186, 2, 'dev6')
|
sqlmesh/core/config/root.py
CHANGED
|
@@ -122,7 +122,7 @@ class Config(BaseConfig):
|
|
|
122
122
|
"""
|
|
123
123
|
|
|
124
124
|
gateways: GatewayDict = {"": GatewayConfig()}
|
|
125
|
-
default_connection: SerializableConnectionConfig =
|
|
125
|
+
default_connection: t.Optional[SerializableConnectionConfig] = None
|
|
126
126
|
default_test_connection_: t.Optional[SerializableConnectionConfig] = Field(
|
|
127
127
|
default=None, alias="default_test_connection"
|
|
128
128
|
)
|
|
@@ -280,7 +280,11 @@ class Config(BaseConfig):
|
|
|
280
280
|
return self.gateways
|
|
281
281
|
|
|
282
282
|
def get_connection(self, gateway_name: t.Optional[str] = None) -> ConnectionConfig:
|
|
283
|
-
|
|
283
|
+
connection = self.get_gateway(gateway_name).connection or self.default_connection
|
|
284
|
+
if connection is None:
|
|
285
|
+
msg = f" for gateway '{gateway_name}'" if gateway_name else ""
|
|
286
|
+
raise ConfigError(f"No connection configured{msg}.")
|
|
287
|
+
return connection
|
|
284
288
|
|
|
285
289
|
def get_state_connection(
|
|
286
290
|
self, gateway_name: t.Optional[str] = None
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from sqlmesh.core.model.definition import (
|
|
2
|
+
ExternalModel,
|
|
3
|
+
PythonModel,
|
|
4
|
+
SeedModel,
|
|
5
|
+
SqlModel,
|
|
6
|
+
)
|
|
7
|
+
import typing as t
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def generate_markdown_description(
|
|
11
|
+
model: t.Union[SqlModel, ExternalModel, PythonModel, SeedModel],
|
|
12
|
+
) -> t.Optional[str]:
|
|
13
|
+
columns = model.columns_to_types
|
|
14
|
+
column_descriptions = model.column_descriptions
|
|
15
|
+
|
|
16
|
+
columns_table = (
|
|
17
|
+
"\n".join(
|
|
18
|
+
[
|
|
19
|
+
f"| {column} | {column_type} | {column_descriptions.get(column, '')} |"
|
|
20
|
+
for column, column_type in columns.items()
|
|
21
|
+
]
|
|
22
|
+
)
|
|
23
|
+
if columns
|
|
24
|
+
else ""
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
table_header = "\n\n| Column | Type | Description |\n|--------|------|-------------|\n"
|
|
28
|
+
return (
|
|
29
|
+
f"{model.description}{table_header}{columns_table}" if columns_table else model.description
|
|
30
|
+
)
|
sqlmesh/lsp/main.py
CHANGED
|
@@ -239,11 +239,12 @@ class SQLMeshLanguageServer:
|
|
|
239
239
|
if not references:
|
|
240
240
|
return None
|
|
241
241
|
reference = references[0]
|
|
242
|
-
if not reference.
|
|
242
|
+
if not reference.markdown_description:
|
|
243
243
|
return None
|
|
244
244
|
return types.Hover(
|
|
245
245
|
contents=types.MarkupContent(
|
|
246
|
-
kind=types.MarkupKind.Markdown,
|
|
246
|
+
kind=types.MarkupKind.Markdown,
|
|
247
|
+
value=reference.markdown_description,
|
|
247
248
|
),
|
|
248
249
|
range=reference.range,
|
|
249
250
|
)
|
sqlmesh/lsp/reference.py
CHANGED
|
@@ -5,6 +5,7 @@ from sqlmesh.core.dialect import normalize_model_name
|
|
|
5
5
|
from sqlmesh.core.model.definition import SqlModel
|
|
6
6
|
from sqlmesh.lsp.context import LSPContext, ModelTarget, AuditTarget
|
|
7
7
|
from sqlglot import exp
|
|
8
|
+
from sqlmesh.lsp.description import generate_markdown_description
|
|
8
9
|
from sqlmesh.lsp.uri import URI
|
|
9
10
|
from sqlmesh.utils.pydantic import PydanticModel
|
|
10
11
|
|
|
@@ -16,12 +17,12 @@ class Reference(PydanticModel):
|
|
|
16
17
|
Attributes:
|
|
17
18
|
range: The range of the reference in the source file
|
|
18
19
|
uri: The uri of the referenced model
|
|
19
|
-
|
|
20
|
+
markdown_description: The markdown description of the referenced model
|
|
20
21
|
"""
|
|
21
22
|
|
|
22
23
|
range: Range
|
|
23
24
|
uri: str
|
|
24
|
-
|
|
25
|
+
markdown_description: t.Optional[str] = None
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
def by_position(position: Position) -> t.Callable[[Reference], bool]:
|
|
@@ -176,11 +177,13 @@ def get_model_definitions_for_a_path(
|
|
|
176
177
|
catalog_or_db_range = _range_from_token_position_details(catalog_or_db_meta, read_file)
|
|
177
178
|
start_pos = catalog_or_db_range.start
|
|
178
179
|
|
|
180
|
+
description = generate_markdown_description(referenced_model)
|
|
181
|
+
|
|
179
182
|
references.append(
|
|
180
183
|
Reference(
|
|
181
184
|
uri=referenced_model_uri.value,
|
|
182
185
|
range=Range(start=start_pos, end=end_pos),
|
|
183
|
-
|
|
186
|
+
markdown_description=description,
|
|
184
187
|
)
|
|
185
188
|
)
|
|
186
189
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
sqlmesh/__init__.py,sha256=69xw6bTmi4cW90M-sl3g6wLDgxVcLHcKg1q8GS3lqyA,7466
|
|
2
|
-
sqlmesh/_version.py,sha256=
|
|
2
|
+
sqlmesh/_version.py,sha256=rh2IWQ893MzOeIex6IJl3PKaC5W0s_yNO2TRV-FVzoY,528
|
|
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
|
|
@@ -52,7 +52,7 @@ sqlmesh/core/config/migration.py,sha256=3lZIlmIcQH3_hIEm3Y3jFtvpw0YXzRzAnk4Odikl
|
|
|
52
52
|
sqlmesh/core/config/model.py,sha256=GIz9kAfKD2NEXNzCZCQ17-CK2OtqN6WgeG1fvibcChM,3650
|
|
53
53
|
sqlmesh/core/config/naming.py,sha256=KVGaxUgswoQajXR_cHFJvgkmEFcU1V182GkOH1SJxuE,326
|
|
54
54
|
sqlmesh/core/config/plan.py,sha256=Sql_bdO2H_vVrIYosf8rWOTRVoMURciX7mEcbMNFFdg,1389
|
|
55
|
-
sqlmesh/core/config/root.py,sha256=
|
|
55
|
+
sqlmesh/core/config/root.py,sha256=q4yD5S6ZoUvCaDNWkm47rGbvITp0JBfBUC37P1a9I9U,14735
|
|
56
56
|
sqlmesh/core/config/run.py,sha256=rIK0QnN_vArrwps2TXGVEbvao2AnGZgzXo7EliJa42E,852
|
|
57
57
|
sqlmesh/core/config/scheduler.py,sha256=essKKkJ6jD5gRT_l-WiKwGKVO1hpDlnf_UdrCvyN5JY,6786
|
|
58
58
|
sqlmesh/core/config/ui.py,sha256=jsO-S6_d9NkLZGG5pT4mgKgxMF34KzkDociZAMvCX3U,278
|
|
@@ -159,8 +159,9 @@ sqlmesh/lsp/api.py,sha256=LJdECSaEZoPbu_Xl4KscVG-WLt7_g4dY-zKGO68dH14,2162
|
|
|
159
159
|
sqlmesh/lsp/completions.py,sha256=Uo8lUzPBeoB58Eu2642YoAtNI0pgIFWFSvwmuJALTv4,3583
|
|
160
160
|
sqlmesh/lsp/context.py,sha256=Ff09vrsawdYS-7YcXbGZW_RU-tj_-k8WV7maCghpYp0,1438
|
|
161
161
|
sqlmesh/lsp/custom.py,sha256=GvNAiW7imPI8xmIx3qLWN5FljGPHFJKh0N5b6aZnwRo,489
|
|
162
|
-
sqlmesh/lsp/
|
|
163
|
-
sqlmesh/lsp/
|
|
162
|
+
sqlmesh/lsp/description.py,sha256=4QIGC9ix8IzmWF6DVUNhY4m1Crk3sNQA6hZ1RbyqU78,827
|
|
163
|
+
sqlmesh/lsp/main.py,sha256=x2rPSDdYtB3S6baXMYUl0XOvvAtyGJhQgVLp_Ql7uPk,18087
|
|
164
|
+
sqlmesh/lsp/reference.py,sha256=bO2edkI2avmEYayQI11_OsDX1gjp36kq9ANwHczWSC0,8285
|
|
164
165
|
sqlmesh/lsp/uri.py,sha256=mvSLbZGmMTHPpliThOtVWiFcHnfJzp1w39q9l-xD2SI,802
|
|
165
166
|
sqlmesh/migrations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
166
167
|
sqlmesh/migrations/v0001_init.py,sha256=h8FwMYJj9_O8yGpk12guaSaGwX5A3we2GiKeHrXi15o,2048
|
|
@@ -268,7 +269,7 @@ sqlmesh/utils/pydantic.py,sha256=I898jAFqa3qU6lG2uPpRebVFncOUo8ZrLWM_R3K3DHU,116
|
|
|
268
269
|
sqlmesh/utils/rich.py,sha256=xNZyPCqEc4TAlJlsEthg-5eYUWpaizz0QjBzO7a1Yv4,1509
|
|
269
270
|
sqlmesh/utils/windows.py,sha256=r7Yin4WEwbvH7sKA3hOJtRsclmscNuBeCklCfVPvtQs,611
|
|
270
271
|
sqlmesh/utils/yaml.py,sha256=np-WVcwmwsKghCgAj1OBBMsK1SXSRn4wR-H37cGiFr8,2282
|
|
271
|
-
sqlmesh-0.186.2.
|
|
272
|
+
sqlmesh-0.186.2.dev6.dist-info/licenses/LICENSE,sha256=OlMefUjgWJdULtf84BLW0AZZcY8DwdgQqb_1j2862j8,11346
|
|
272
273
|
web/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
273
274
|
web/client/dist/index.html,sha256=M50OuwjW63dRCS0Dz40Yecgvw9ecLFqizbTa6gv5Nd4,5472
|
|
274
275
|
web/client/dist/assets/Audits-BPlxzqeG.js,sha256=TCx1qCjCGgmUSvH6HoPr5t8ztbRXMlOxrcW4o7hRjlA,1041
|
|
@@ -386,8 +387,8 @@ web/server/api/endpoints/models.py,sha256=ud-lRwriyI_OYg9tZchrBgeiXELiRTLNEodraf
|
|
|
386
387
|
web/server/api/endpoints/modules.py,sha256=8hqqgonGay_mJmpCw0IdbjsPhWlQH2VLdKAqha-myac,468
|
|
387
388
|
web/server/api/endpoints/plan.py,sha256=OYuQ_4dgbhG9ibTcX1a8mvYgH3ANxw9Fhbb4wg6QWqc,9222
|
|
388
389
|
web/server/api/endpoints/table_diff.py,sha256=Wd5YxeKbZB7AkrDvqFgvV9ZQlnKYOF1n5W_w2EHE_Zw,2085
|
|
389
|
-
sqlmesh-0.186.2.
|
|
390
|
-
sqlmesh-0.186.2.
|
|
391
|
-
sqlmesh-0.186.2.
|
|
392
|
-
sqlmesh-0.186.2.
|
|
393
|
-
sqlmesh-0.186.2.
|
|
390
|
+
sqlmesh-0.186.2.dev6.dist-info/METADATA,sha256=tGUGXdtbBjYe2oHqUPnYXeM0d-Y-F6JMRZtYfU9rFT8,25523
|
|
391
|
+
sqlmesh-0.186.2.dev6.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
|
|
392
|
+
sqlmesh-0.186.2.dev6.dist-info/entry_points.txt,sha256=pIYKtg-u-uO7BK_Y0qrdmfyj0bYrcMc3Xiqr5WE3VFk,121
|
|
393
|
+
sqlmesh-0.186.2.dev6.dist-info/top_level.txt,sha256=bspjo5vjELQkuN0qKuTFIbsrUt3Zeo8D2mlKeHG1LdE,12
|
|
394
|
+
sqlmesh-0.186.2.dev6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|