Skip to content

Commit 02f44c4

Browse files
author
maxi297
committed
support creation_response interpolation in body
1 parent 447ace6 commit 02f44c4

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

airbyte_cdk/sources/declarative/requesters/request_options/interpolated_nested_request_input_provider.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
)
1212
from airbyte_cdk.sources.declarative.interpolation.interpolated_string import InterpolatedString
1313
from airbyte_cdk.sources.types import Config, StreamSlice
14+
from airbyte_cdk.utils.mapping_helpers import get_interpolation_context
1415

1516

1617
@dataclass
@@ -52,8 +53,8 @@ def eval_request_inputs(
5253
:param next_page_token: The pagination token
5354
:return: The request inputs to set on an outgoing HTTP request
5455
"""
55-
kwargs = {
56-
"stream_slice": stream_slice,
57-
"next_page_token": next_page_token,
58-
}
56+
kwargs = get_interpolation_context(
57+
stream_slice=stream_slice,
58+
next_page_token=next_page_token,
59+
)
5960
return self._interpolator.eval(self.config, **kwargs) # type: ignore # self._interpolator is always initialized with a value and will not be None

airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_input_provider.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from airbyte_cdk.sources.declarative.interpolation.interpolated_mapping import InterpolatedMapping
99
from airbyte_cdk.sources.declarative.interpolation.interpolated_string import InterpolatedString
1010
from airbyte_cdk.sources.types import Config, StreamSlice, StreamState
11+
from airbyte_cdk.utils.mapping_helpers import get_interpolation_context
1112

1213

1314
@dataclass
@@ -51,10 +52,10 @@ def eval_request_inputs(
5152
:param valid_value_types: A tuple of types that the interpolator should allow
5253
:return: The request inputs to set on an outgoing HTTP request
5354
"""
54-
kwargs = {
55-
"stream_slice": stream_slice,
56-
"next_page_token": next_page_token,
57-
}
55+
kwargs = get_interpolation_context(
56+
stream_slice=stream_slice,
57+
next_page_token=next_page_token,
58+
)
5859
interpolated_value = self._interpolator.eval( # type: ignore # self._interpolator is always initialized with a value and will not be None
5960
self.config,
6061
valid_key_types=valid_key_types,

0 commit comments

Comments
 (0)