Skip to content

Commit f25a7ee

Browse files
committed
temp [ci skip]
1 parent 4d59f06 commit f25a7ee

File tree

6 files changed

+24
-23
lines changed

6 files changed

+24
-23
lines changed

sqlmesh/core/node.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class _Node(PydanticModel):
196196
interval_unit_: t.Optional[IntervalUnit] = Field(alias="interval_unit", default=None)
197197
tags: t.List[str] = []
198198
stamp: t.Optional[str] = None
199-
_path: t.Optional[Path] = Path()
199+
_path: t.Optional[Path] = None
200200
_data_hash: t.Optional[str] = None
201201
_metadata_hash: t.Optional[str] = None
202202

sqlmesh/lsp/reference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def get_model_definitions_for_a_path(
241241
if referenced_model_path is None:
242242
continue
243243
# Check whether the path exists
244-
if referenced_model_path is None or not referenced_model_path.is_file():
244+
if not referenced_model_path.is_file():
245245
continue
246246
referenced_model_uri = URI.from_path(referenced_model_path)
247247

vscode/openapi.json

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,8 +1382,14 @@
13821382
"properties": {
13831383
"name": { "type": "string", "title": "Name" },
13841384
"fqn": { "type": "string", "title": "Fqn" },
1385-
"path": { "type": "string", "title": "Path" },
1386-
"full_path": { "type": "string", "title": "Full Path" },
1385+
"path": {
1386+
"anyOf": [{ "type": "string" }, { "type": "null" }],
1387+
"title": "Path"
1388+
},
1389+
"full_path": {
1390+
"anyOf": [{ "type": "string" }, { "type": "null" }],
1391+
"title": "Full Path"
1392+
},
13871393
"dialect": { "type": "string", "title": "Dialect" },
13881394
"type": { "$ref": "#/components/schemas/ModelType" },
13891395
"columns": {
@@ -1417,16 +1423,7 @@
14171423
},
14181424
"additionalProperties": false,
14191425
"type": "object",
1420-
"required": [
1421-
"name",
1422-
"fqn",
1423-
"path",
1424-
"full_path",
1425-
"dialect",
1426-
"type",
1427-
"columns",
1428-
"hash"
1429-
],
1426+
"required": ["name", "fqn", "dialect", "type", "columns", "hash"],
14301427
"title": "Model"
14311428
},
14321429
"ModelDetails": {
@@ -2143,7 +2140,7 @@
21432140
"TestCase": {
21442141
"properties": {
21452142
"name": { "type": "string", "title": "Name" },
2146-
"path": { "type": "string", "format": "path", "title": "Path" }
2143+
"path": { "type": "string", "title": "Path" }
21472144
},
21482145
"additionalProperties": false,
21492146
"type": "object",
@@ -2153,7 +2150,7 @@
21532150
"TestErrorOrFailure": {
21542151
"properties": {
21552152
"name": { "type": "string", "title": "Name" },
2156-
"path": { "type": "string", "format": "path", "title": "Path" },
2153+
"path": { "type": "string", "title": "Path" },
21572154
"tb": { "type": "string", "title": "Tb" }
21582155
},
21592156
"additionalProperties": false,
@@ -2193,7 +2190,7 @@
21932190
"TestSkipped": {
21942191
"properties": {
21952192
"name": { "type": "string", "title": "Name" },
2196-
"path": { "type": "string", "format": "path", "title": "Path" },
2193+
"path": { "type": "string", "title": "Path" },
21972194
"reason": { "type": "string", "title": "Reason" }
21982195
},
21992196
"additionalProperties": false,

vscode/react/src/api/client.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@ export interface Meta {
289289
has_running_task?: boolean
290290
}
291291

292+
export type ModelPath = string | null
293+
294+
export type ModelFullPath = string | null
295+
292296
export type ModelDescription = string | null
293297

294298
export type ModelDetailsProperty = ModelDetails | null
@@ -302,8 +306,8 @@ export type ModelDefaultCatalog = string | null
302306
export interface Model {
303307
name: string
304308
fqn: string
305-
path: string
306-
full_path: string
309+
path?: ModelPath
310+
full_path?: ModelFullPath
307311
dialect: string
308312
type: ModelType
309313
columns: Column[]

web/server/api/endpoints/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ def serialize_model(context: Context, model: Model, render_query: bool = False)
131131
return models.Model(
132132
name=model.name,
133133
fqn=model.fqn,
134-
path=str(path.absolute().relative_to(context.path).as_posix()),
135-
full_path=str(path.absolute().as_posix()),
134+
path=str(path.absolute().relative_to(context.path).as_posix()) if path else None,
135+
full_path=str(path.absolute().as_posix()) if path else None,
136136
dialect=dialect,
137137
columns=columns,
138138
details=details,

web/server/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ class Column(PydanticModel):
171171
class Model(PydanticModel):
172172
name: str
173173
fqn: str
174-
path: str
175-
full_path: str
174+
path: t.Optional[str] = None
175+
full_path: t.Optional[str] = None
176176
"""
177177
As opposed to path, which is relative to the project root, full_path is the absolute path to the model file.
178178
"""

0 commit comments

Comments
 (0)