Skip to content

Commit

Permalink
added comment to explain behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
tinomerl committed Dec 2, 2024
1 parent dbffc27 commit e19b95e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions airbyte/_writers/file_writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ def _get_new_cache_file_path(
batch_id = batch_id or str(ulid.ULID())
target_dir = Path(self._cache_dir)
target_dir.mkdir(parents=True, exist_ok=True)
# If a stream contains a special Character, the temporary jsonl.gz
# file can't be created, because of OS restrictions. Therefore, we
# remove the special characters.
cleaned_stream_name = re.sub(r"[^a-zA-Z0-9\s]", "", stream_name)
return target_dir / f"{cleaned_stream_name}_{batch_id}{self.default_cache_file_suffix}"

Expand Down

0 comments on commit e19b95e

Please sign in to comment.