Skip to content

Commit 199d99a

Browse files
committed
file-mode-api: remove_unnecesary absolut_path field from _get_file_transfer_paths response
1 parent 6db0406 commit 199d99a

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

airbyte_cdk/sources/file_based/file_based_stream_reader.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class AbstractFileBasedStreamReader(ABC):
3333
FILE_RELATIVE_PATH = "file_relative_path"
3434
FILE_NAME = "file_name"
3535
LOCAL_FILE_PATH = "local_file_path"
36-
ABSOLUTE_FILE_PATH = "absolute_file_path"
3736
SOURCE_FILE_URI = "source_file_relative_path"
3837
FILE_FOLDER = "file_folder"
3938

@@ -190,12 +189,10 @@ def _get_file_transfer_paths(self, file: RemoteFile, local_directory: str) -> Mu
190189
local_file_path = path.join(local_directory, file_relative_path)
191190
# Ensure the local directory exists
192191
makedirs(path.dirname(local_file_path), exist_ok=True)
193-
absolute_file_path = path.abspath(local_file_path)
194192

195193
file_paths = {
196194
self.FILE_RELATIVE_PATH: file_relative_path,
197195
self.LOCAL_FILE_PATH: local_file_path,
198-
self.ABSOLUTE_FILE_PATH: absolute_file_path,
199196
self.FILE_NAME: file_name,
200197
self.FILE_FOLDER: file_folder,
201198
self.SOURCE_FILE_URI: file_uri,

unit_tests/sources/file_based/test_file_based_stream_reader.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ def test_globs_and_prefixes_from_globs(
384384

385385

386386
@pytest.mark.parametrize(
387-
"config, source_file, expected_file_relative_path, expected_local_file_path, expected_absolute_file_path",
387+
"config, source_file, expected_file_relative_path, expected_local_file_path",
388388
[
389389
pytest.param(
390390
{
@@ -397,7 +397,6 @@ def test_globs_and_prefixes_from_globs(
397397
"mirror_paths_testing/not_duplicates/data/jan/monthly-kickoff-202402.mpeg",
398398
"mirror_paths_testing/not_duplicates/data/jan/monthly-kickoff-202402.mpeg",
399399
"/tmp/transfer-files/mirror_paths_testing/not_duplicates/data/jan/monthly-kickoff-202402.mpeg",
400-
"/tmp/transfer-files/mirror_paths_testing/not_duplicates/data/jan/monthly-kickoff-202402.mpeg",
401400
id="preserve_directories_present_and_true",
402401
),
403402
pytest.param(
@@ -411,23 +410,20 @@ def test_globs_and_prefixes_from_globs(
411410
"mirror_paths_testing/not_duplicates/data/jan/monthly-kickoff-202402.mpeg",
412411
"monthly-kickoff-202402.mpeg",
413412
"/tmp/transfer-files/monthly-kickoff-202402.mpeg",
414-
"/tmp/transfer-files/monthly-kickoff-202402.mpeg",
415413
id="preserve_directories_present_and_false",
416414
),
417415
pytest.param(
418416
{"streams": [], "delivery_method": {"delivery_type": "use_file_transfer"}},
419417
"mirror_paths_testing/not_duplicates/data/jan/monthly-kickoff-202402.mpeg",
420418
"mirror_paths_testing/not_duplicates/data/jan/monthly-kickoff-202402.mpeg",
421419
"/tmp/transfer-files/mirror_paths_testing/not_duplicates/data/jan/monthly-kickoff-202402.mpeg",
422-
"/tmp/transfer-files/mirror_paths_testing/not_duplicates/data/jan/monthly-kickoff-202402.mpeg",
423420
id="preserve_directories_not_present_defaults_true",
424421
),
425422
pytest.param(
426423
{"streams": []},
427424
"mirror_paths_testing/not_duplicates/data/jan/monthly-kickoff-202402.mpeg",
428425
"mirror_paths_testing/not_duplicates/data/jan/monthly-kickoff-202402.mpeg",
429426
"/tmp/transfer-files/mirror_paths_testing/not_duplicates/data/jan/monthly-kickoff-202402.mpeg",
430-
"/tmp/transfer-files/mirror_paths_testing/not_duplicates/data/jan/monthly-kickoff-202402.mpeg",
431427
id="file_transfer_flag_not_present_defaults_true",
432428
),
433429
],
@@ -437,7 +433,6 @@ def test_preserve_sub_directories_scenarios(
437433
source_file: str,
438434
expected_file_relative_path: str,
439435
expected_local_file_path: str,
440-
expected_absolute_file_path: str,
441436
) -> None:
442437
remote_file = RemoteFile(
443438
uri=source_file,
@@ -452,7 +447,6 @@ def test_preserve_sub_directories_scenarios(
452447

453448
assert file_paths[AbstractFileBasedStreamReader.FILE_RELATIVE_PATH] == expected_file_relative_path
454449
assert file_paths[AbstractFileBasedStreamReader.LOCAL_FILE_PATH] == expected_local_file_path
455-
assert file_paths[AbstractFileBasedStreamReader.ABSOLUTE_FILE_PATH] == expected_absolute_file_path
456450
assert file_paths[AbstractFileBasedStreamReader.SOURCE_FILE_URI] == source_file
457451
assert file_paths[AbstractFileBasedStreamReader.FILE_NAME] == path.basename(source_file)
458452
assert file_paths[AbstractFileBasedStreamReader.FILE_FOLDER] == path.dirname(source_file)

0 commit comments

Comments
 (0)