Skip to content

Commit 2cbd065

Browse files
author
octavia-squidington-iii
committed
Auto-fix lint and format issues
1 parent 6445211 commit 2cbd065

File tree

7 files changed

+41
-32
lines changed

7 files changed

+41
-32
lines changed

airbyte_cdk/models/airbyte_protocol.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from airbyte_protocol_dataclasses.models import * # noqa: F403 # Allow '*'
99
from serpyco_rs.metadata import Alias
1010

11-
1211
# ruff: noqa: F405 # ignore fuzzy import issues with 'import *'
1312

1413

airbyte_cdk/sources/declarative/extractors/record_selector.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from airbyte_cdk.sources.declarative.transformations import RecordTransformation
2020
from airbyte_cdk.sources.types import Config, Record, StreamSlice, StreamState
2121
from airbyte_cdk.sources.utils.transform import TypeTransformer
22-
from airbyte_cdk.sources.declarative.retrievers.file_uploader import FileUploader
2322

2423

2524
@dataclass

airbyte_cdk/sources/file_based/schema_helpers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
# we use the File attributes for metadata records.
2323
file_transfer_schema = {
2424
"type": "object",
25-
"properties": {"uri": {"type": "string"}, "last_modified": {"type": "string"}, "mime_type": {"type": ["null", "string"]}},
25+
"properties": {
26+
"uri": {"type": "string"},
27+
"last_modified": {"type": "string"},
28+
"mime_type": {"type": ["null", "string"]},
29+
},
2630
}
2731

2832

airbyte_cdk/sources/file_based/stream/permissions_file_based_stream.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ def read_records_from_slice(self, stream_slice: StreamSlice) -> Iterable[Airbyte
6161
permissions_record = self.transform_record(
6262
permissions_record, file, file_datetime_string
6363
)
64-
yield stream_data_to_airbyte_message(
65-
self.name, permissions_record
66-
)
64+
yield stream_data_to_airbyte_message(self.name, permissions_record)
6765
except Exception as e:
6866
self.logger.error(f"Failed to retrieve permissions for file {file.uri}: {str(e)}")
6967
yield AirbyteMessage(

unit_tests/sources/file_based/scenarios/csv_scenarios.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,7 @@
11411141
"source_defined_cursor": True,
11421142
"supported_sync_modes": ["full_refresh", "incremental"],
11431143
"is_resumable": True,
1144-
"is_file_based": False
1144+
"is_file_based": False,
11451145
}
11461146
]
11471147
}
@@ -1229,7 +1229,7 @@
12291229
"source_defined_cursor": True,
12301230
"supported_sync_modes": ["full_refresh", "incremental"],
12311231
"is_resumable": True,
1232-
"is_file_based": False
1232+
"is_file_based": False,
12331233
},
12341234
{
12351235
"json_schema": {
@@ -1245,7 +1245,7 @@
12451245
"default_cursor_field": ["_ab_source_file_last_modified"],
12461246
"supported_sync_modes": ["full_refresh", "incremental"],
12471247
"is_resumable": True,
1248-
"is_file_based": False
1248+
"is_file_based": False,
12491249
},
12501250
]
12511251
}
@@ -2108,7 +2108,7 @@
21082108
"source_defined_cursor": True,
21092109
"supported_sync_modes": ["full_refresh", "incremental"],
21102110
"is_resumable": True,
2111-
"is_file_based": False
2111+
"is_file_based": False,
21122112
}
21132113
]
21142114
}
@@ -2211,7 +2211,7 @@
22112211
"default_cursor_field": ["_ab_source_file_last_modified"],
22122212
"supported_sync_modes": ["full_refresh", "incremental"],
22132213
"is_resumable": True,
2214-
"is_file_based": False
2214+
"is_file_based": False,
22152215
},
22162216
]
22172217
}
@@ -2630,7 +2630,7 @@
26302630
"source_defined_cursor": True,
26312631
"supported_sync_modes": ["full_refresh", "incremental"],
26322632
"is_resumable": True,
2633-
"is_file_based": False
2633+
"is_file_based": False,
26342634
}
26352635
]
26362636
}

unit_tests/sources/file_based/scenarios/incremental_scenarios.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@
450450
"source_defined_cursor": True,
451451
"supported_sync_modes": ["full_refresh", "incremental"],
452452
"is_resumable": True,
453-
"is_file_based": False
453+
"is_file_based": False,
454454
}
455455
]
456456
}
@@ -678,7 +678,7 @@
678678
"source_defined_cursor": True,
679679
"supported_sync_modes": ["full_refresh", "incremental"],
680680
"is_resumable": True,
681-
"is_file_based": False
681+
"is_file_based": False,
682682
}
683683
]
684684
}
@@ -980,7 +980,7 @@
980980
"source_defined_cursor": True,
981981
"supported_sync_modes": ["full_refresh", "incremental"],
982982
"is_resumable": True,
983-
"is_file_based": False
983+
"is_file_based": False,
984984
}
985985
]
986986
}
@@ -1133,7 +1133,7 @@
11331133
"source_defined_cursor": True,
11341134
"supported_sync_modes": ["full_refresh", "incremental"],
11351135
"is_resumable": True,
1136-
"is_file_based": False
1136+
"is_file_based": False,
11371137
}
11381138
]
11391139
}
@@ -1264,7 +1264,7 @@
12641264
"source_defined_cursor": True,
12651265
"supported_sync_modes": ["full_refresh", "incremental"],
12661266
"is_resumable": True,
1267-
"is_file_based": False
1267+
"is_file_based": False,
12681268
}
12691269
]
12701270
}
@@ -1639,7 +1639,7 @@
16391639
"source_defined_cursor": True,
16401640
"supported_sync_modes": ["full_refresh", "incremental"],
16411641
"is_resumable": True,
1642-
"is_file_based": False
1642+
"is_file_based": False,
16431643
}
16441644
]
16451645
}
@@ -1756,7 +1756,7 @@
17561756
"source_defined_cursor": True,
17571757
"supported_sync_modes": ["full_refresh", "incremental"],
17581758
"is_resumable": True,
1759-
"is_file_based": False
1759+
"is_file_based": False,
17601760
}
17611761
]
17621762
}
@@ -1897,7 +1897,7 @@
18971897
"source_defined_cursor": True,
18981898
"supported_sync_modes": ["full_refresh", "incremental"],
18991899
"is_resumable": True,
1900-
"is_file_based": False
1900+
"is_file_based": False,
19011901
}
19021902
]
19031903
}

unit_tests/sources/file_based/stream/test_default_file_based_stream.py

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@
1212

1313
import pytest
1414

15-
from airbyte_cdk.models import AirbyteLogMessage, AirbyteMessage, Level
16-
from airbyte_cdk.models import Type as MessageType, AirbyteRecordMessageFileReference
15+
from airbyte_cdk.models import (
16+
AirbyteLogMessage,
17+
AirbyteMessage,
18+
AirbyteRecordMessageFileReference,
19+
Level,
20+
)
21+
from airbyte_cdk.models import Type as MessageType
1722
from airbyte_cdk.sources.file_based.availability_strategy import (
1823
AbstractFileBasedAvailabilityStrategy,
1924
)
@@ -323,19 +328,23 @@ def setUp(self) -> None:
323328

324329
def test_when_read_records_from_slice_then_return_records(self) -> None:
325330
"""Verify that we have the new file method and data is empty"""
326-
with mock.patch.object(FileTransfer, "upload", return_value=[self._A_FILE_REFERENCE_MESSAGE]):
331+
with mock.patch.object(
332+
FileTransfer, "upload", return_value=[self._A_FILE_REFERENCE_MESSAGE]
333+
):
327334
remote_file = RemoteFile(uri="uri", last_modified=self._NOW)
328-
messages = list(
329-
self._stream.read_records_from_slice(
330-
{"files": [remote_file]}
331-
)
332-
)
335+
messages = list(self._stream.read_records_from_slice({"files": [remote_file]}))
333336

334-
assert list(map(lambda message: message.record.file_reference, messages)) == [self._A_FILE_REFERENCE_MESSAGE]
337+
assert list(map(lambda message: message.record.file_reference, messages)) == [
338+
self._A_FILE_REFERENCE_MESSAGE
339+
]
335340
assert list(map(lambda message: message.record.data, messages)) == [
336-
{'_ab_source_file_last_modified': remote_file.last_modified.strftime("%Y-%m-%dT%H:%M:%S.%fZ"),
337-
'_ab_source_file_url': remote_file.uri}]
338-
341+
{
342+
"_ab_source_file_last_modified": remote_file.last_modified.strftime(
343+
"%Y-%m-%dT%H:%M:%S.%fZ"
344+
),
345+
"_ab_source_file_url": remote_file.uri,
346+
}
347+
]
339348

340349
def test_when_compute_slices(self) -> None:
341350
all_files = [

0 commit comments

Comments
 (0)