Skip to content

Commit fc7044c

Browse files
authored
Fix: Skip directories in a dbt project that the user is not permitted to access (#1179)
1 parent e220475 commit fc7044c

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

sqlmesh/dbt/loader.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,12 +175,17 @@ def _compute_yaml_max_mtime_per_subfolder(self, root: Path) -> t.Dict[Path, floa
175175
max_mtime: t.Optional[float] = None
176176

177177
for nested in root.iterdir():
178-
if nested.is_dir():
179-
result.update(self._compute_yaml_max_mtime_per_subfolder(nested))
180-
elif nested.suffix.lower() in (".yaml", ".yml"):
181-
yaml_mtime = self._path_mtimes.get(nested)
182-
if yaml_mtime:
183-
max_mtime = max(max_mtime, yaml_mtime) if max_mtime is not None else yaml_mtime
178+
try:
179+
if nested.is_dir():
180+
result.update(self._compute_yaml_max_mtime_per_subfolder(nested))
181+
elif nested.suffix.lower() in (".yaml", ".yml"):
182+
yaml_mtime = self._path_mtimes.get(nested)
183+
if yaml_mtime:
184+
max_mtime = (
185+
max(max_mtime, yaml_mtime) if max_mtime is not None else yaml_mtime
186+
)
187+
except PermissionError:
188+
pass
184189

185190
if max_mtime is not None:
186191
result[root] = max_mtime

0 commit comments

Comments
 (0)