Commit ea54711 1 parent f001d17 commit ea54711 Copy full SHA for ea54711
File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 13
13
from airbyte import exceptions as exc
14
14
from airbyte import progress
15
15
from airbyte ._batch_handles import BatchHandle
16
+ from airbyte ._util .name_normalizers import LowerCaseNormalizer
16
17
from airbyte ._writers .base import AirbyteWriterInterface
17
18
from airbyte .records import StreamRecord , StreamRecordHandler
18
19
@@ -61,7 +62,14 @@ def _get_new_cache_file_path(
61
62
batch_id = batch_id or str (ulid .ULID ())
62
63
target_dir = Path (self ._cache_dir )
63
64
target_dir .mkdir (parents = True , exist_ok = True )
64
- return target_dir / f"{ stream_name } _{ batch_id } { self .default_cache_file_suffix } "
65
+ # If a stream contains a special Character, the temporary jsonl.gz
66
+ # file can't be created, because of OS restrictions. Therefore, we
67
+ # remove the special characters, using the `LowerCaseNormalizer`.
68
+ # Specifically: we remove any of these characters: `<>:"/\|?*`
69
+ # and we remove characters in the ASCII range from 0 to 31.
70
+ normalizer = LowerCaseNormalizer ()
71
+ normalized_stream_name = normalizer .normalize (stream_name )
72
+ return target_dir / f"{ normalized_stream_name } _{ batch_id } { self .default_cache_file_suffix } "
65
73
66
74
def _open_new_file (
67
75
self ,
You can’t perform that action at this time.
0 commit comments