Skip to content

Commit 0582aed

Browse files
author
Oleksandr Bazarnov
committed
renamed url_requester > download_target_requester
1 parent 8071e89 commit 0582aed

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

airbyte_cdk/sources/declarative/declarative_component_schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3264,7 +3264,7 @@ definitions:
32643264
anyOf:
32653265
- "$ref": "#/definitions/CustomRequester"
32663266
- "$ref": "#/definitions/HttpRequester"
3267-
url_requester:
3267+
download_target_requester:
32683268
description: Requester component that describes how to prepare HTTP requests to send to the source API to extract the url from polling response by the completed async job.
32693269
anyOf:
32703270
- "$ref": "#/definitions/CustomRequester"

airbyte_cdk/sources/declarative/models/declarative_component_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2278,7 +2278,7 @@ class AsyncRetriever(BaseModel):
22782278
...,
22792279
description="Requester component that describes how to prepare HTTP requests to send to the source API to fetch the status of the running async job.",
22802280
)
2281-
url_requester: Optional[Union[CustomRequester, HttpRequester]] = Field(
2281+
download_target_requester: Optional[Union[CustomRequester, HttpRequester]] = Field(
22822282
None,
22832283
description="Requester component that describes how to prepare HTTP requests to send to the source API to extract the url from polling response by the completed async job.",
22842284
)

airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2744,14 +2744,14 @@ def _get_download_retriever() -> SimpleRetrieverTestReadDecorator | SimpleRetrie
27442744
if model.delete_requester
27452745
else None
27462746
)
2747-
url_requester = (
2747+
download_target_requester = (
27482748
self._create_component_from_model(
2749-
model=model.url_requester,
2749+
model=model.download_target_requester,
27502750
decoder=decoder,
27512751
config=config,
27522752
name=f"job extract_url - {name}",
27532753
)
2754-
if model.url_requester
2754+
if model.download_target_requester
27552755
else None
27562756
)
27572757
status_extractor = self._create_component_from_model(
@@ -2764,7 +2764,7 @@ def _get_download_retriever() -> SimpleRetrieverTestReadDecorator | SimpleRetrie
27642764
creation_requester=creation_requester,
27652765
polling_requester=polling_requester,
27662766
download_retriever=download_retriever,
2767-
url_requester=url_requester,
2767+
download_target_requester=download_target_requester,
27682768
abort_requester=abort_requester,
27692769
delete_requester=delete_requester,
27702770
status_extractor=status_extractor,

airbyte_cdk/sources/declarative/requesters/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# AsyncHttpJobRepository sequence diagram
22

33
- Components marked as optional are not required and can be ignored.
4-
- if `url_requester` is not provided, `download_target_extractor` will get urls from the `polling_response`
4+
- if `download_target_requester` is not provided, `download_target_extractor` will get urls from the `polling_response`
55
- interpolation_context, e.g. `creation_response` or `polling_response` can be obtained from stream_slice
66

77
```mermaid
@@ -12,7 +12,7 @@ sequenceDiagram
1212
participant AsyncHttpJobRepository as AsyncOrchestrator
1313
participant CreationRequester as creation_requester
1414
participant PollingRequester as polling_requester
15-
participant UrlRequester as url_requester (Optional)
15+
participant UrlRequester as download_target_requester (Optional)
1616
participant DownloadRetriever as download_retriever
1717
participant AbortRequester as abort_requester (Optional)
1818
participant DeleteRequester as delete_requester (Optional)

airbyte_cdk/sources/declarative/requesters/http_job_repository.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class AsyncHttpJobRepository(AsyncJobRepository):
4949
record_extractor: RecordExtractor = field(
5050
init=False, repr=False, default_factory=lambda: ResponseToFileExtractor({})
5151
)
52-
url_requester: Optional[Requester] = (
52+
download_target_requester: Optional[Requester] = (
5353
None # use it in case polling_requester provides some <id> and extra request is needed to obtain list of urls to download from
5454
)
5555

@@ -281,7 +281,7 @@ def _get_create_job_stream_slice(self, job: AsyncJob) -> StreamSlice:
281281
return stream_slice
282282

283283
def _get_download_targets(self, job: AsyncJob) -> Iterable[str]:
284-
if not self.url_requester:
284+
if not self.download_target_requester:
285285
url_response = self._polling_job_response_by_id[job.api_job_id()]
286286
else:
287287
polling_response = self._polling_job_response_by_id[job.api_job_id()].json()
@@ -290,10 +290,10 @@ def _get_download_targets(self, job: AsyncJob) -> Iterable[str]:
290290
cursor_slice={},
291291
extra_fields={"polling_response": polling_response},
292292
)
293-
url_response = self.url_requester.send_request(stream_slice=stream_slice) # type: ignore # we expect url_requester to always be presented, otherwise raise an exception as we cannot proceed with the report
293+
url_response = self.download_target_requester.send_request(stream_slice=stream_slice) # type: ignore # we expect download_target_requester to always be presented, otherwise raise an exception as we cannot proceed with the report
294294
if not url_response:
295295
raise AirbyteTracedException(
296-
internal_message="Always expect a response or an exception from url_requester",
296+
internal_message="Always expect a response or an exception from download_target_requester",
297297
failure_type=FailureType.system_error,
298298
)
299299

0 commit comments

Comments
 (0)