Skip to content

Commit

Permalink
apply additional autofixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsteers committed Nov 10, 2024
1 parent e02cf31 commit 879f78b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@ def process(self, record: AirbyteRecordMessage) -> tuple[list[Chunk], str | None
)
for chunk_document in self._split_document(doc)
]
id_to_delete = (
doc.metadata.get(METADATA_RECORD_ID_FIELD, None)
)
id_to_delete = doc.metadata.get(METADATA_RECORD_ID_FIELD, None)
return chunks, id_to_delete

def _generate_document(self, record: AirbyteRecordMessage) -> Document | None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ def is_done(self) -> bool:
3. All partitions for all streams are closed
"""
is_done = all(
self._is_stream_done(stream_name)
for stream_name in self._stream_name_to_instance
self._is_stream_done(stream_name) for stream_name in self._stream_name_to_instance
)
if is_done and self._exceptions_per_stream_name:
error_message = generate_failed_streams_error_message(self._exceptions_per_stream_name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ def interpret_response(
if matched_error_resolution.response_action == ResponseAction.SUCCESS:
return matched_error_resolution

if (
matched_error_resolution.response_action in {ResponseAction.RETRY, ResponseAction.IGNORE}
):
if matched_error_resolution.response_action in {
ResponseAction.RETRY,
ResponseAction.IGNORE,
}:
return matched_error_resolution
if matched_error_resolution:
return matched_error_resolution
Expand Down
1 change: 1 addition & 0 deletions airbyte_cdk/sources/streams/call_rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# prevents mypy from complaining about missing session attributes in LimiterMixin
if TYPE_CHECKING:
from collections.abc import Mapping

MIXIN_BASE = requests.Session
else:
MIXIN_BASE = object
Expand Down
2 changes: 1 addition & 1 deletion airbyte_cdk/test/catalog_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@ def with_stream(

def build(self) -> ConfiguredAirbyteCatalog:
return ConfiguredAirbyteCatalog(
streams=[builder.build() for builder in self._streams]
streams=[builder.build() for builder in self._streams],
)

0 comments on commit 879f78b

Please sign in to comment.