Skip to content

Commit

Permalink
Ignore invalid filepaths to create the dbt dir cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
tatiana committed Jul 16, 2024
1 parent ad9024e commit e0d45f3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Changelog
=========

1.5.1a2 (2024-07-17)
1.5.1a3 (2024-07-17)
--------------------

Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion cosmos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Contains dags, task groups, and operators.
"""
__version__ = "1.5.1a2"
__version__ = "1.5.1a3"

from cosmos.airflow.dag import DbtDag
from cosmos.airflow.task_group import DbtTaskGroup
Expand Down
9 changes: 6 additions & 3 deletions cosmos/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,12 @@ def _create_folder_version_hash(dir_path: Path) -> str:
filepaths.extend(paths)

for filepath in sorted(filepaths):
with open(str(filepath), "rb") as fp:
buf = fp.read()
hasher.update(buf)
try:
with open(str(filepath), "rb") as fp:
buf = fp.read()
hasher.update(buf)
except FileNotFoundError:
logger.debug(f"Skipping invalid path {filepath}")

Check warning on line 238 in cosmos/cache.py

View check run for this annotation

Codecov / codecov/patch

cosmos/cache.py#L237-L238

Added lines #L237 - L238 were not covered by tests

return hasher.hexdigest()

Expand Down

0 comments on commit e0d45f3

Please sign in to comment.