Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Added regex to sub special characters #545

Merged
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion airbyte/_writers/file_writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from __future__ import annotations

import abc
import re
from collections import defaultdict
from pathlib import Path
from typing import IO, TYPE_CHECKING, final
Expand Down Expand Up @@ -61,7 +62,11 @@ 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)
return target_dir / f"{stream_name}_{batch_id}{self.default_cache_file_suffix}"
# 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.
aaronsteers marked this conversation as resolved.
Show resolved Hide resolved
cleaned_stream_name = re.sub(r'[<>:"/\\|?*\x00-\x1F]', "", stream_name)
return target_dir / f"{cleaned_stream_name}_{batch_id}{self.default_cache_file_suffix}"

def _open_new_file(
self,
Expand Down