Skip to content

Commit 8a0b89e

Browse files
committed
temp [ci skip]
1 parent 7c41a08 commit 8a0b89e

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

sqlmesh/core/context.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,15 +1076,12 @@ def format(
10761076
**kwargs: t.Any,
10771077
) -> bool:
10781078
"""Format all SQL models and audits."""
1079-
unformatted_file_paths = []
1080-
format_targets = {**self._models, **self._audits}
1081-
1082-
for target in format_targets.values():
1083-
if target._path is None or target._path.suffix != ".sql":
1084-
continue
1085-
if paths and not any(target._path.samefile(p) for p in paths):
1086-
continue
1087-
1079+
filtered_targets = [
1080+
target for target in self._models.values() | self._audits.values()
1081+
if target._path is not None and target._path.suffix == ".sql"
1082+
and (not paths or any(target._path.samefile(p) for p in paths))
1083+
]
1084+
for target in filtered_targets:
10881085
with open(target._path, "r+", encoding="utf-8") as file:
10891086
before = file.read()
10901087
expressions = parse(before, default_dialect=self.config_for_node(target).dialect)

0 commit comments

Comments
 (0)