From 687c86fad6bda83852301cd513fb48404d0fc2dd Mon Sep 17 00:00:00 2001 From: Aaron Steers Date: Sun, 10 Nov 2024 18:50:30 -0800 Subject: [PATCH] typing fixes --- .../interpolation/interpolated_boolean.py | 1 + .../parsers/model_to_component_factory.py | 14 +++++++------- airbyte_cdk/sources/streams/http/http.py | 6 +++++- airbyte_cdk/sources/streams/http/http_client.py | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/airbyte_cdk/sources/declarative/interpolation/interpolated_boolean.py b/airbyte_cdk/sources/declarative/interpolation/interpolated_boolean.py index 0dfb8f48..1a6832bf 100644 --- a/airbyte_cdk/sources/declarative/interpolation/interpolated_boolean.py +++ b/airbyte_cdk/sources/declarative/interpolation/interpolated_boolean.py @@ -41,6 +41,7 @@ class InterpolatedBoolean: Attributes: condition (str): The string representing the condition to evaluate to a boolean """ + condition: str parameters: InitVar[Mapping[str, Any]] diff --git a/airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py b/airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py index 4d83e07b..5415ba22 100644 --- a/airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py +++ b/airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py @@ -2167,13 +2167,13 @@ def create_async_retriever( return AsyncRetriever( job_orchestrator_factory=lambda stream_slices: AsyncJobOrchestrator( - job_repository, - stream_slices, - JobTracker( - 1 - ), # TODO: eventually make the number of concurrent jobs in the API configurable. Until then, we limit to 1 # noqa: FIX001, TD001, TD004 - self._message_repository, - has_bulk_parent=False, # TODO: work would need to be done here in order to detect if a stream as a parent stream that is bulk # noqa: FIX001, TD001, TD004 + job_repository=job_repository, + slices=stream_slices, + job_tracker=JobTracker( + limit=1 + ), # TODO: eventually make the number of concurrent jobs in the API configurable. Until then, we limit to 1 + message_repository=self._message_repository, + has_bulk_parent=False, # TODO: work would need to be done here in order to detect if a stream as a parent stream that is bulk ), record_selector=record_selector, stream_slicer=stream_slicer, diff --git a/airbyte_cdk/sources/streams/http/http.py b/airbyte_cdk/sources/streams/http/http.py index a474fdc4..c3169e5a 100644 --- a/airbyte_cdk/sources/streams/http/http.py +++ b/airbyte_cdk/sources/streams/http/http.py @@ -593,7 +593,11 @@ def backoff_time( reason="You should set error_handler explicitly in HttpStream.get_error_handler() instead.", ) class HttpStreamAdapterHttpStatusErrorHandler(HttpStatusErrorHandler): - def __init__(self, stream: HttpStream, **kwargs): # type: ignore # noqa + def __init__( + self, + stream: HttpStream, + **kwargs: Any, # noqa: ANN401 (any-type) + ) -> None: self.stream = stream super().__init__(**kwargs) diff --git a/airbyte_cdk/sources/streams/http/http_client.py b/airbyte_cdk/sources/streams/http/http_client.py index 80aa5310..e7e54f42 100644 --- a/airbyte_cdk/sources/streams/http/http_client.py +++ b/airbyte_cdk/sources/streams/http/http_client.py @@ -81,7 +81,7 @@ class HttpClient: _DEFAULT_MAX_RETRY: int = 5 _DEFAULT_MAX_TIME: int = 60 * 10 - def __init__( + def __init__( # noqa: PLR0913 (too-many-arguments) self, name: str, logger: logging.Logger,