airbyte-cdk 6.45.0.dev4100__py3-none-any.whl → 6.45.0.dev4101__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- airbyte_cdk/sources/file_based/file_based_stream_reader.py +24 -6
- {airbyte_cdk-6.45.0.dev4100.dist-info → airbyte_cdk-6.45.0.dev4101.dist-info}/METADATA +1 -1
- {airbyte_cdk-6.45.0.dev4100.dist-info → airbyte_cdk-6.45.0.dev4101.dist-info}/RECORD +7 -7
- {airbyte_cdk-6.45.0.dev4100.dist-info → airbyte_cdk-6.45.0.dev4101.dist-info}/LICENSE.txt +0 -0
- {airbyte_cdk-6.45.0.dev4100.dist-info → airbyte_cdk-6.45.0.dev4101.dist-info}/LICENSE_SHORT +0 -0
- {airbyte_cdk-6.45.0.dev4100.dist-info → airbyte_cdk-6.45.0.dev4101.dist-info}/WHEEL +0 -0
- {airbyte_cdk-6.45.0.dev4100.dist-info → airbyte_cdk-6.45.0.dev4101.dist-info}/entry_points.txt +0 -0
@@ -8,7 +8,7 @@ from datetime import datetime
|
|
8
8
|
from enum import Enum
|
9
9
|
from io import IOBase
|
10
10
|
from os import makedirs, path
|
11
|
-
from typing import Iterable, List, Optional, Set, Tuple
|
11
|
+
from typing import Any, Iterable, List, Optional, Set, Tuple, MutableMapping
|
12
12
|
|
13
13
|
from wcmatch.glob import GLOBSTAR, globmatch
|
14
14
|
|
@@ -30,6 +30,12 @@ class FileReadMode(Enum):
|
|
30
30
|
|
31
31
|
class AbstractFileBasedStreamReader(ABC):
|
32
32
|
DATE_TIME_FORMAT = "%Y-%m-%dT%H:%M:%S.%fZ"
|
33
|
+
FILE_RELATIVE_PATH = "file_relative_path"
|
34
|
+
FILE_NAME = "file_name"
|
35
|
+
LOCAL_FILE_PATH = "local_file_path"
|
36
|
+
ABSOLUTE_FILE_PATH = "absolute_file_path"
|
37
|
+
SOURCE_FILE_URI = "source_file_relative_path"
|
38
|
+
FILE_FOLDER = "file_folder"
|
33
39
|
|
34
40
|
def __init__(self) -> None:
|
35
41
|
self._config = None
|
@@ -171,16 +177,28 @@ class AbstractFileBasedStreamReader(ABC):
|
|
171
177
|
"""
|
172
178
|
...
|
173
179
|
|
174
|
-
def _get_file_transfer_paths(self, file: RemoteFile, local_directory: str) ->
|
180
|
+
def _get_file_transfer_paths(self, file: RemoteFile, local_directory: str) -> MutableMapping[str, Any]:
|
175
181
|
preserve_directory_structure = self.preserve_directory_structure()
|
182
|
+
file_uri = file.uri
|
183
|
+
file_name = path.basename(file_uri)
|
184
|
+
file_folder = path.dirname(file_uri)
|
176
185
|
if preserve_directory_structure:
|
177
186
|
# Remove left slashes from source path format to make relative path for writing locally
|
178
|
-
file_relative_path =
|
187
|
+
file_relative_path = file_uri.lstrip("/")
|
179
188
|
else:
|
180
|
-
file_relative_path =
|
189
|
+
file_relative_path = file_name
|
181
190
|
local_file_path = path.join(local_directory, file_relative_path)
|
182
|
-
|
183
191
|
# Ensure the local directory exists
|
184
192
|
makedirs(path.dirname(local_file_path), exist_ok=True)
|
185
193
|
absolute_file_path = path.abspath(local_file_path)
|
186
|
-
|
194
|
+
|
195
|
+
file_paths = {
|
196
|
+
self.FILE_RELATIVE_PATH: file_relative_path,
|
197
|
+
self.LOCAL_FILE_PATH: local_file_path,
|
198
|
+
self.ABSOLUTE_FILE_PATH: absolute_file_path,
|
199
|
+
self.FILE_NAME: file_name,
|
200
|
+
self.FILE_FOLDER: file_folder,
|
201
|
+
self.SOURCE_FILE_URI: file_uri,
|
202
|
+
|
203
|
+
}
|
204
|
+
return file_paths
|
@@ -216,7 +216,7 @@ airbyte_cdk/sources/file_based/discovery_policy/default_discovery_policy.py,sha2
|
|
216
216
|
airbyte_cdk/sources/file_based/exceptions.py,sha256=WP0qkG6fpWoBpOyyicgp5YNE393VWyegq5qSy0v4QtM,7362
|
217
217
|
airbyte_cdk/sources/file_based/file_based_source.py,sha256=bIsut7ivHcl7YPO9cygDn0to23MRLu1Sym7jSr0Iy9A,20051
|
218
218
|
airbyte_cdk/sources/file_based/file_based_stream_permissions_reader.py,sha256=4e7FXqQ9hueacexC0SyrZyjF8oREYHza8pKF9CgKbD8,5050
|
219
|
-
airbyte_cdk/sources/file_based/file_based_stream_reader.py,sha256=
|
219
|
+
airbyte_cdk/sources/file_based/file_based_stream_reader.py,sha256=r6pjkBfCigTKFd_Z5fGpGR1Ovwxf9rzoFRlec79PGIw,7565
|
220
220
|
airbyte_cdk/sources/file_based/file_record_data.py,sha256=HXduy_owayUhgmbuswOl5UnszWPUAkRiNhDJgZVCVZI,471
|
221
221
|
airbyte_cdk/sources/file_based/file_types/__init__.py,sha256=blCLn0-2LC-ZdgcNyDEhqM2RiUvEjEBh-G4-t32ZtuM,1268
|
222
222
|
airbyte_cdk/sources/file_based/file_types/avro_parser.py,sha256=XNx-JC-sgzH9u3nOJ2M59FxBXvtig8LN6BIkeDOavZA,10858
|
@@ -360,9 +360,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
|
|
360
360
|
airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
|
361
361
|
airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
|
362
362
|
airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
|
363
|
-
airbyte_cdk-6.45.0.
|
364
|
-
airbyte_cdk-6.45.0.
|
365
|
-
airbyte_cdk-6.45.0.
|
366
|
-
airbyte_cdk-6.45.0.
|
367
|
-
airbyte_cdk-6.45.0.
|
368
|
-
airbyte_cdk-6.45.0.
|
363
|
+
airbyte_cdk-6.45.0.dev4101.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
|
364
|
+
airbyte_cdk-6.45.0.dev4101.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
|
365
|
+
airbyte_cdk-6.45.0.dev4101.dist-info/METADATA,sha256=frrTZ5l7oK6p9W0qqoqqv477xm-g3HEabYR46sHs2p8,6089
|
366
|
+
airbyte_cdk-6.45.0.dev4101.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
367
|
+
airbyte_cdk-6.45.0.dev4101.dist-info/entry_points.txt,sha256=fj-e3PAQvsxsQzyyq8UkG1k8spunWnD4BAH2AwlR6NM,95
|
368
|
+
airbyte_cdk-6.45.0.dev4101.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
{airbyte_cdk-6.45.0.dev4100.dist-info → airbyte_cdk-6.45.0.dev4101.dist-info}/entry_points.txt
RENAMED
File without changes
|