Skip to content

Commit 052eb81

Browse files
committed
update type hints
1 parent 38d13d3 commit 052eb81

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

airbyte_cdk/legacy/sources/declarative/declarative_stream.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ def get_cursor(self) -> Optional[Cursor]:
202202
return self.retriever.cursor
203203
return None
204204

205-
def fetch_record(self, pk_value: Any) -> Optional[Mapping[str, Any]]:
205+
def fetch_record(
206+
self,
207+
pk_value: Any | Mapping[str, Any],
208+
) -> Optional[Mapping[str, Any]]:
206209
"""
207210
Fetch a single record by primary key value.
208211

airbyte_cdk/sources/abstract_source.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@ def read(
198198
logger.info(timer.report())
199199

200200
if len(stream_name_to_exception) > 0:
201-
error_message = generate_failed_streams_error_message(
202-
{key: [value] for key, value in stream_name_to_exception.items()}
203-
)
201+
error_message = generate_failed_streams_error_message({
202+
key: [value] for key, value in stream_name_to_exception.items()
203+
})
204204
logger.info(error_message)
205205
# We still raise at least one exception when a stream raises an exception because the platform currently relies
206206
# on a non-zero exit code to determine if a sync attempt has failed. We also raise the exception as a config_error
@@ -326,7 +326,10 @@ def stop_sync_on_stream_failure(self) -> bool:
326326
return False
327327

328328
def fetch_record(
329-
self, stream_name: str, pk_value: Any, config: Mapping[str, Any]
329+
self,
330+
stream_name: str,
331+
pk_value: Any | Mapping[str, Any],
332+
config: Mapping[str, Any],
330333
) -> Optional[Mapping[str, Any]]:
331334
"""
332335
Fetch a single record from a stream by primary key.

0 commit comments

Comments
 (0)