Skip to content

Commit 2461127

Browse files
authored
skip file parsing if no content (#1633)
1 parent da73d87 commit 2461127

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

web/client/openapi.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,15 @@
11211121
},
11221122
"IntervalUnit": {
11231123
"type": "string",
1124-
"enum": ["year", "month", "day", "hour", "minute"],
1124+
"enum": [
1125+
"year",
1126+
"month",
1127+
"day",
1128+
"hour",
1129+
"half_hour",
1130+
"quarter_hour",
1131+
"five_minute"
1132+
],
11251133
"title": "IntervalUnit",
11261134
"description": "IntervalUnit is the inferred granularity of an incremental node.\n\nIntervalUnit can be one of 5 types, YEAR, MONTH, DAY, HOUR, MINUTE. The unit is inferred\nbased on the cron schedule of a node. The minimum time delta between a sample set of dates\nis used to determine which unit a node's schedule is."
11271135
},

web/server/api/endpoints/files.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ async def write_file(
7474
replace_file(settings.project_path / path, settings.project_path / path_or_new_path)
7575
else:
7676
full_path = settings.project_path / path
77-
if pathlib.Path(path_or_new_path).suffix == ".sql":
77+
if content and pathlib.Path(path_or_new_path).suffix == ".sql":
7878
path_to_model_mapping = await get_path_to_model_mapping(settings=settings)
7979
model = path_to_model_mapping.get(Path(full_path))
8080
default_dialect = context.config_for_path(Path(path_or_new_path)).dialect

0 commit comments

Comments
 (0)