airbyte-cdk 6.48.11__py3-none-any.whl → 6.48.12__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py +15 -2
- airbyte_cdk/sources/declarative/retrievers/simple_retriever.py +15 -44
- {airbyte_cdk-6.48.11.dist-info → airbyte_cdk-6.48.12.dist-info}/METADATA +1 -1
- {airbyte_cdk-6.48.11.dist-info → airbyte_cdk-6.48.12.dist-info}/RECORD +8 -8
- {airbyte_cdk-6.48.11.dist-info → airbyte_cdk-6.48.12.dist-info}/LICENSE.txt +0 -0
- {airbyte_cdk-6.48.11.dist-info → airbyte_cdk-6.48.12.dist-info}/LICENSE_SHORT +0 -0
- {airbyte_cdk-6.48.11.dist-info → airbyte_cdk-6.48.12.dist-info}/WHEEL +0 -0
- {airbyte_cdk-6.48.11.dist-info → airbyte_cdk-6.48.12.dist-info}/entry_points.txt +0 -0
@@ -26,6 +26,7 @@ from typing import (
|
|
26
26
|
|
27
27
|
from isodate import parse_duration
|
28
28
|
from pydantic.v1 import BaseModel
|
29
|
+
from requests import Response
|
29
30
|
|
30
31
|
from airbyte_cdk.connector_builder.models import (
|
31
32
|
LogMessage as ConnectorBuilderLogMessage,
|
@@ -529,6 +530,7 @@ from airbyte_cdk.sources.declarative.transformations.keys_to_lower_transformatio
|
|
529
530
|
from airbyte_cdk.sources.declarative.transformations.keys_to_snake_transformation import (
|
530
531
|
KeysToSnakeCaseTransformation,
|
531
532
|
)
|
533
|
+
from airbyte_cdk.sources.http_logger import format_http_message
|
532
534
|
from airbyte_cdk.sources.message import (
|
533
535
|
InMemoryMessageRepository,
|
534
536
|
LogAppenderMessageRepositoryDecorator,
|
@@ -2390,15 +2392,24 @@ class ModelToComponentFactory:
|
|
2390
2392
|
schema_transformations.append(
|
2391
2393
|
self._create_component_from_model(model=transformation_model, config=config)
|
2392
2394
|
)
|
2393
|
-
|
2395
|
+
name = "dynamic_properties"
|
2394
2396
|
retriever = self._create_component_from_model(
|
2395
2397
|
model=model.retriever,
|
2396
2398
|
config=config,
|
2397
|
-
name=
|
2399
|
+
name=name,
|
2398
2400
|
primary_key=None,
|
2399
2401
|
stream_slicer=combined_slicers,
|
2400
2402
|
transformations=[],
|
2401
2403
|
use_cache=True,
|
2404
|
+
log_formatter=(
|
2405
|
+
lambda response: format_http_message(
|
2406
|
+
response,
|
2407
|
+
f"Schema loader '{name}' request",
|
2408
|
+
f"Request performed in order to extract schema.",
|
2409
|
+
name,
|
2410
|
+
is_auxiliary=True,
|
2411
|
+
)
|
2412
|
+
),
|
2402
2413
|
)
|
2403
2414
|
schema_type_identifier = self._create_component_from_model(
|
2404
2415
|
model.schema_type_identifier, config=config, parameters=model.parameters or {}
|
@@ -2985,6 +2996,7 @@ class ModelToComponentFactory:
|
|
2985
2996
|
]
|
2986
2997
|
] = None,
|
2987
2998
|
use_cache: Optional[bool] = None,
|
2999
|
+
log_formatter: Optional[Callable[[Response], Any]] = None,
|
2988
3000
|
**kwargs: Any,
|
2989
3001
|
) -> SimpleRetriever:
|
2990
3002
|
def _get_url() -> str:
|
@@ -3161,6 +3173,7 @@ class ModelToComponentFactory:
|
|
3161
3173
|
config=config,
|
3162
3174
|
maximum_number_of_slices=self._limit_slices_fetched or 5,
|
3163
3175
|
ignore_stream_slicer_parameters_on_paginated_requests=ignore_stream_slicer_parameters_on_paginated_requests,
|
3176
|
+
log_formatter=log_formatter,
|
3164
3177
|
parameters=model.parameters or {},
|
3165
3178
|
)
|
3166
3179
|
return SimpleRetriever(
|
@@ -10,7 +10,6 @@ from itertools import islice
|
|
10
10
|
from typing import (
|
11
11
|
Any,
|
12
12
|
Callable,
|
13
|
-
Dict,
|
14
13
|
Iterable,
|
15
14
|
List,
|
16
15
|
Mapping,
|
@@ -93,6 +92,7 @@ class SimpleRetriever(Retriever):
|
|
93
92
|
cursor: Optional[DeclarativeCursor] = None
|
94
93
|
ignore_stream_slicer_parameters_on_paginated_requests: bool = False
|
95
94
|
additional_query_properties: Optional[QueryProperties] = None
|
95
|
+
log_formatter: Optional[Callable[[requests.Response], Any]] = None
|
96
96
|
|
97
97
|
def __post_init__(self, parameters: Mapping[str, Any]) -> None:
|
98
98
|
self._paginator = self.paginator or NoPagination(parameters=parameters)
|
@@ -353,6 +353,7 @@ class SimpleRetriever(Retriever):
|
|
353
353
|
stream_slice=stream_slice,
|
354
354
|
next_page_token=next_page_token,
|
355
355
|
),
|
356
|
+
log_formatter=self.log_formatter,
|
356
357
|
)
|
357
358
|
|
358
359
|
# This logic is similar to _read_pages in the HttpStream class. When making changes here, consider making changes there as well.
|
@@ -655,6 +656,19 @@ class SimpleRetrieverTestReadDecorator(SimpleRetriever):
|
|
655
656
|
|
656
657
|
def __post_init__(self, options: Mapping[str, Any]) -> None:
|
657
658
|
super().__post_init__(options)
|
659
|
+
self.log_formatter = (
|
660
|
+
(
|
661
|
+
lambda response: format_http_message(
|
662
|
+
response,
|
663
|
+
f"Stream '{self.name}' request",
|
664
|
+
f"Request performed in order to extract records for stream '{self.name}'",
|
665
|
+
self.name,
|
666
|
+
)
|
667
|
+
)
|
668
|
+
if not self.log_formatter
|
669
|
+
else self.log_formatter
|
670
|
+
)
|
671
|
+
|
658
672
|
if self.maximum_number_of_slices and self.maximum_number_of_slices < 1:
|
659
673
|
raise ValueError(
|
660
674
|
f"The maximum number of slices on a test read needs to be strictly positive. Got {self.maximum_number_of_slices}"
|
@@ -664,49 +678,6 @@ class SimpleRetrieverTestReadDecorator(SimpleRetriever):
|
|
664
678
|
def stream_slices(self) -> Iterable[Optional[StreamSlice]]: # type: ignore
|
665
679
|
return islice(super().stream_slices(), self.maximum_number_of_slices)
|
666
680
|
|
667
|
-
def _fetch_next_page(
|
668
|
-
self,
|
669
|
-
stream_state: Mapping[str, Any],
|
670
|
-
stream_slice: StreamSlice,
|
671
|
-
next_page_token: Optional[Mapping[str, Any]] = None,
|
672
|
-
) -> Optional[requests.Response]:
|
673
|
-
return self.requester.send_request(
|
674
|
-
path=self._paginator_path(
|
675
|
-
next_page_token=next_page_token,
|
676
|
-
stream_state=stream_state,
|
677
|
-
stream_slice=stream_slice,
|
678
|
-
),
|
679
|
-
stream_state=stream_state,
|
680
|
-
stream_slice=stream_slice,
|
681
|
-
next_page_token=next_page_token,
|
682
|
-
request_headers=self._request_headers(
|
683
|
-
stream_state=stream_state,
|
684
|
-
stream_slice=stream_slice,
|
685
|
-
next_page_token=next_page_token,
|
686
|
-
),
|
687
|
-
request_params=self._request_params(
|
688
|
-
stream_state=stream_state,
|
689
|
-
stream_slice=stream_slice,
|
690
|
-
next_page_token=next_page_token,
|
691
|
-
),
|
692
|
-
request_body_data=self._request_body_data(
|
693
|
-
stream_state=stream_state,
|
694
|
-
stream_slice=stream_slice,
|
695
|
-
next_page_token=next_page_token,
|
696
|
-
),
|
697
|
-
request_body_json=self._request_body_json(
|
698
|
-
stream_state=stream_state,
|
699
|
-
stream_slice=stream_slice,
|
700
|
-
next_page_token=next_page_token,
|
701
|
-
),
|
702
|
-
log_formatter=lambda response: format_http_message(
|
703
|
-
response,
|
704
|
-
f"Stream '{self.name}' request",
|
705
|
-
f"Request performed in order to extract records for stream '{self.name}'",
|
706
|
-
self.name,
|
707
|
-
),
|
708
|
-
)
|
709
|
-
|
710
681
|
|
711
682
|
@deprecated(
|
712
683
|
"This class is experimental. Use at your own risk.",
|
@@ -140,7 +140,7 @@ airbyte_cdk/sources/declarative/parsers/custom_exceptions.py,sha256=wnRUP0Xeru9R
|
|
140
140
|
airbyte_cdk/sources/declarative/parsers/manifest_component_transformer.py,sha256=RUyFZS0zslLb7UfQrvqMC--k5CVLNSp7zHw6kbosvKE,9688
|
141
141
|
airbyte_cdk/sources/declarative/parsers/manifest_normalizer.py,sha256=laBy7ebjA-PiNwc-50U4FHvMqS_mmHvnabxgFs4CjGw,17069
|
142
142
|
airbyte_cdk/sources/declarative/parsers/manifest_reference_resolver.py,sha256=pJmg78vqE5VfUrF_KJnWjucQ4k9IWFULeAxHCowrHXE,6806
|
143
|
-
airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=
|
143
|
+
airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,sha256=Ai-3RfSoBa3oNc34KNlUvp7KbbQuuqhtGwGOxPf8fMc,167671
|
144
144
|
airbyte_cdk/sources/declarative/partition_routers/__init__.py,sha256=TBC9AkGaUqHm2IKHMPN6punBIcY5tWGULowcLoAVkfw,1109
|
145
145
|
airbyte_cdk/sources/declarative/partition_routers/async_job_partition_router.py,sha256=VelO7zKqKtzMJ35jyFeg0ypJLQC0plqqIBNXoBW1G2E,3001
|
146
146
|
airbyte_cdk/sources/declarative/partition_routers/cartesian_product_stream_slicer.py,sha256=c5cuVFM6NFkuQqG8Z5IwkBuwDrvXZN1CunUOM_L0ezg,6892
|
@@ -207,7 +207,7 @@ airbyte_cdk/sources/declarative/retrievers/file_uploader/file_writer.py,sha256=V
|
|
207
207
|
airbyte_cdk/sources/declarative/retrievers/file_uploader/local_file_system_file_writer.py,sha256=jLpdonre1UHfbjGSD5AK_T0codLABJByTvbqepDZtEQ,422
|
208
208
|
airbyte_cdk/sources/declarative/retrievers/file_uploader/noop_file_writer.py,sha256=1yfimzxm09d2j605cu_HhiYVDNVL1rUMi3vs_jYlIyY,330
|
209
209
|
airbyte_cdk/sources/declarative/retrievers/retriever.py,sha256=XPLs593Xv8c5cKMc37XzUAYmzlXd1a7eSsspM-CMuWA,1696
|
210
|
-
airbyte_cdk/sources/declarative/retrievers/simple_retriever.py,sha256=
|
210
|
+
airbyte_cdk/sources/declarative/retrievers/simple_retriever.py,sha256=Ui7V_etQ-sI4GCFJqgt1bn9c5BA21dyzCJwqnKZMYTc,29876
|
211
211
|
airbyte_cdk/sources/declarative/schema/__init__.py,sha256=xU45UvM5O4c1PSM13UHpCdh5hpW3HXy9vRRGEiAC1rg,795
|
212
212
|
airbyte_cdk/sources/declarative/schema/composite_schema_loader.py,sha256=ymGbvxS_QyGc4nnjEyRo5ch8bVedELO41PAUxKXZyMw,1113
|
213
213
|
airbyte_cdk/sources/declarative/schema/default_schema_loader.py,sha256=UnbzlExmwoQiVV8zDg4lhAEaqA_0pRfwbMRe8yqOuWk,1834
|
@@ -408,9 +408,9 @@ airbyte_cdk/utils/slice_hasher.py,sha256=EDxgROHDbfG-QKQb59m7h_7crN1tRiawdf5uU7G
|
|
408
408
|
airbyte_cdk/utils/spec_schema_transformations.py,sha256=-5HTuNsnDBAhj-oLeQXwpTGA0HdcjFOf2zTEMUTTg_Y,816
|
409
409
|
airbyte_cdk/utils/stream_status_utils.py,sha256=ZmBoiy5HVbUEHAMrUONxZvxnvfV9CesmQJLDTAIWnWw,1171
|
410
410
|
airbyte_cdk/utils/traced_exception.py,sha256=C8uIBuCL_E4WnBAOPSxBicD06JAldoN9fGsQDp463OY,6292
|
411
|
-
airbyte_cdk-6.48.
|
412
|
-
airbyte_cdk-6.48.
|
413
|
-
airbyte_cdk-6.48.
|
414
|
-
airbyte_cdk-6.48.
|
415
|
-
airbyte_cdk-6.48.
|
416
|
-
airbyte_cdk-6.48.
|
411
|
+
airbyte_cdk-6.48.12.dist-info/LICENSE.txt,sha256=Wfe61S4BaGPj404v8lrAbvhjYR68SHlkzeYrg3_bbuM,1051
|
412
|
+
airbyte_cdk-6.48.12.dist-info/LICENSE_SHORT,sha256=aqF6D1NcESmpn-cqsxBtszTEnHKnlsp8L4x9wAh3Nxg,55
|
413
|
+
airbyte_cdk-6.48.12.dist-info/METADATA,sha256=jqI_OETxlvr-K862CNigYQtRBNP7grACKsJZXkxFnH0,6344
|
414
|
+
airbyte_cdk-6.48.12.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
415
|
+
airbyte_cdk-6.48.12.dist-info/entry_points.txt,sha256=AKWbEkHfpzzk9nF9tqBUaw1MbvTM4mGtEzmZQm0ZWvM,139
|
416
|
+
airbyte_cdk-6.48.12.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|