From 1a5ec137b047ca3869c5f708ff50903dcdb28828 Mon Sep 17 00:00:00 2001 From: Sergey Chvalyuk Date: Thu, 10 Nov 2022 20:50:05 +0200 Subject: [PATCH 1/8] skip filtering for get_request_body_json Signed-off-by: Sergey Chvalyuk --- .../interpolated_request_input_provider.py | 7 +------ .../interpolated_request_options_provider.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_input_provider.py b/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_input_provider.py index 370e5d8caeacd..44b00b3506c20 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_input_provider.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_input_provider.py @@ -42,9 +42,4 @@ def eval_request_inputs( :return: The request inputs to set on an outgoing HTTP request """ kwargs = {"stream_state": stream_state, "stream_slice": stream_slice, "next_page_token": next_page_token} - interpolated_value = self._interpolator.eval(self.config, **kwargs) - - if isinstance(interpolated_value, dict): - non_null_tokens = {k: v for k, v in interpolated_value.items() if v} - return non_null_tokens - return interpolated_value + return self._interpolator.eval(self.config, **kwargs) diff --git a/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_options_provider.py b/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_options_provider.py index 5dd5dbda9b35f..65793fd7983fa 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_options_provider.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_options_provider.py @@ -68,7 +68,7 @@ def get_request_params( ) -> MutableMapping[str, Any]: interpolated_value = self._parameter_interpolator.eval_request_inputs(stream_state, stream_slice, next_page_token) if isinstance(interpolated_value, dict): - return interpolated_value + return {k: v for k, v in interpolated_value.items() if v} return {} def get_request_headers( @@ -78,7 +78,10 @@ def get_request_headers( stream_slice: Optional[StreamSlice] = None, next_page_token: Optional[Mapping[str, Any]] = None, ) -> Mapping[str, Any]: - return self._headers_interpolator.eval_request_inputs(stream_state, stream_slice, next_page_token) + interpolated_value = self._headers_interpolator.eval_request_inputs(stream_state, stream_slice, next_page_token) + if isinstance(interpolated_value, dict): + interpolated_value = {k: v for k, v in interpolated_value.items() if v} + return interpolated_value def get_request_body_data( self, @@ -87,7 +90,10 @@ def get_request_body_data( stream_slice: Optional[StreamSlice] = None, next_page_token: Optional[Mapping[str, Any]] = None, ) -> Optional[Union[Mapping, str]]: - return self._body_data_interpolator.eval_request_inputs(stream_state, stream_slice, next_page_token) + interpolated_value = self._body_data_interpolator.eval_request_inputs(stream_state, stream_slice, next_page_token) + if isinstance(interpolated_value, dict): + interpolated_value = {k: v for k, v in interpolated_value.items() if v} + return interpolated_value def get_request_body_json( self, From 34f3060504b4f3a911e65eaead45f62cdc605a52 Mon Sep 17 00:00:00 2001 From: Sergey Chvalyuk Date: Thu, 10 Nov 2022 22:31:07 +0200 Subject: [PATCH 2/8] test_interpolated_request_json fixed Signed-off-by: Sergey Chvalyuk --- .../test_interpolated_request_options_provider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airbyte-cdk/python/unit_tests/sources/declarative/requesters/request_options/test_interpolated_request_options_provider.py b/airbyte-cdk/python/unit_tests/sources/declarative/requesters/request_options/test_interpolated_request_options_provider.py index 457ddc9a22d8b..32729849cbf69 100644 --- a/airbyte-cdk/python/unit_tests/sources/declarative/requesters/request_options/test_interpolated_request_options_provider.py +++ b/airbyte-cdk/python/unit_tests/sources/declarative/requesters/request_options/test_interpolated_request_options_provider.py @@ -45,7 +45,7 @@ def test_interpolated_request_params(test_name, input_request_params, expected_r ("test_value_depends_on_stream_slice", {"read_from_slice": "{{ stream_slice['start_date'] }}"}, {"read_from_slice": "2020-01-01"}), ("test_value_depends_on_next_page_token", {"read_from_token": "{{ next_page_token['offset'] }}"}, {"read_from_token": 12345}), ("test_value_depends_on_config", {"read_from_config": "{{ config['option'] }}"}, {"read_from_config": "OPTION"}), - ("test_none_value", {"missing_json": "{{ fake_path['date'] }}"}, {}), + ("test_none_value", {"missing_json": "{{ fake_path['date'] }}"}, {"missing_json": None}), ( "test_interpolated_keys", {"{{ stream_state['date'] }}": 123, "{{ config['option'] }}": "ABC"}, From 95dd447c18648671099d852b8768d944d3491493 Mon Sep 17 00:00:00 2001 From: Sergey Chvalyuk Date: Thu, 10 Nov 2022 22:53:52 +0200 Subject: [PATCH 3/8] bump 0.8.1 Signed-off-by: Sergey Chvalyuk --- airbyte-cdk/python/CHANGELOG.md | 3 +++ airbyte-cdk/python/setup.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/airbyte-cdk/python/CHANGELOG.md b/airbyte-cdk/python/CHANGELOG.md index df550bb0d53af..1404d4a1cc87e 100644 --- a/airbyte-cdk/python/CHANGELOG.md +++ b/airbyte-cdk/python/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## 0.8.1 +Low-code: Don't filter failed interpolated vars for `request_options_provider.request_body_json` + ## 0.8.0 Low-code: Allow for request and response to be emitted as log messages diff --git a/airbyte-cdk/python/setup.py b/airbyte-cdk/python/setup.py index 09570bdbe5823..773743d05205c 100644 --- a/airbyte-cdk/python/setup.py +++ b/airbyte-cdk/python/setup.py @@ -15,7 +15,7 @@ setup( name="airbyte-cdk", - version="0.8.0", + version="0.8.1", description="A framework for writing Airbyte Connectors.", long_description=README, long_description_content_type="text/markdown", From 6451ef4d6c1cf2d0cb6384780bc9543910a9f380 Mon Sep 17 00:00:00 2001 From: Sergey Chvalyuk Date: Thu, 10 Nov 2022 23:23:49 +0200 Subject: [PATCH 4/8] re-implement with filter_items Signed-off-by: Sergey Chvalyuk --- .../interpolated_request_input_provider.py | 6 +++++- .../interpolated_request_options_provider.py | 14 ++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_input_provider.py b/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_input_provider.py index 44b00b3506c20..05ca70be22ca7 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_input_provider.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_input_provider.py @@ -21,6 +21,7 @@ class InterpolatedRequestInputProvider: config: Config = field(default_factory=dict) _interpolator: Union[InterpolatedString, InterpolatedMapping] = field(init=False, repr=False, default=None) _request_inputs: Union[str, Mapping[str, str]] = field(init=False, repr=False, default=None) + filter_items: bool = True def __post_init__(self, options: Mapping[str, Any]): @@ -42,4 +43,7 @@ def eval_request_inputs( :return: The request inputs to set on an outgoing HTTP request """ kwargs = {"stream_state": stream_state, "stream_slice": stream_slice, "next_page_token": next_page_token} - return self._interpolator.eval(self.config, **kwargs) + interpolated_value = self._interpolator.eval(self.config, **kwargs) + if self.filter_items and isinstance(interpolated_value, dict): + interpolated_value = {k: v for k, v in interpolated_value.items() if v} + return interpolated_value diff --git a/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_options_provider.py b/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_options_provider.py index 65793fd7983fa..75962ad9bb0aa 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_options_provider.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_options_provider.py @@ -56,7 +56,7 @@ def __post_init__(self, options: Mapping[str, Any]): config=self.config, request_inputs=self.request_body_data, options=options ) self._body_json_interpolator = InterpolatedRequestInputProvider( - config=self.config, request_inputs=self.request_body_json, options=options + config=self.config, request_inputs=self.request_body_json, options=options, filter_items=False ) def get_request_params( @@ -68,7 +68,7 @@ def get_request_params( ) -> MutableMapping[str, Any]: interpolated_value = self._parameter_interpolator.eval_request_inputs(stream_state, stream_slice, next_page_token) if isinstance(interpolated_value, dict): - return {k: v for k, v in interpolated_value.items() if v} + return interpolated_value return {} def get_request_headers( @@ -78,10 +78,7 @@ def get_request_headers( stream_slice: Optional[StreamSlice] = None, next_page_token: Optional[Mapping[str, Any]] = None, ) -> Mapping[str, Any]: - interpolated_value = self._headers_interpolator.eval_request_inputs(stream_state, stream_slice, next_page_token) - if isinstance(interpolated_value, dict): - interpolated_value = {k: v for k, v in interpolated_value.items() if v} - return interpolated_value + return self._headers_interpolator.eval_request_inputs(stream_state, stream_slice, next_page_token) def get_request_body_data( self, @@ -90,10 +87,7 @@ def get_request_body_data( stream_slice: Optional[StreamSlice] = None, next_page_token: Optional[Mapping[str, Any]] = None, ) -> Optional[Union[Mapping, str]]: - interpolated_value = self._body_data_interpolator.eval_request_inputs(stream_state, stream_slice, next_page_token) - if isinstance(interpolated_value, dict): - interpolated_value = {k: v for k, v in interpolated_value.items() if v} - return interpolated_value + return self._body_data_interpolator.eval_request_inputs(stream_state, stream_slice, next_page_token) def get_request_body_json( self, From 4462b233af4a6d8ec3b7eeca479cf4a310a20d71 Mon Sep 17 00:00:00 2001 From: Sergey Chvalyuk Date: Fri, 11 Nov 2022 01:10:29 +0200 Subject: [PATCH 5/8] tests improved Signed-off-by: Sergey Chvalyuk --- .../test_interpolated_request_options_provider.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/airbyte-cdk/python/unit_tests/sources/declarative/requesters/request_options/test_interpolated_request_options_provider.py b/airbyte-cdk/python/unit_tests/sources/declarative/requesters/request_options/test_interpolated_request_options_provider.py index 32729849cbf69..d4f49dbacea32 100644 --- a/airbyte-cdk/python/unit_tests/sources/declarative/requesters/request_options/test_interpolated_request_options_provider.py +++ b/airbyte-cdk/python/unit_tests/sources/declarative/requesters/request_options/test_interpolated_request_options_provider.py @@ -21,12 +21,17 @@ ("test_value_depends_on_stream_slice", {"read_from_slice": "{{ stream_slice['start_date'] }}"}, {"read_from_slice": "2020-01-01"}), ("test_value_depends_on_next_page_token", {"read_from_token": "{{ next_page_token['offset'] }}"}, {"read_from_token": 12345}), ("test_value_depends_on_config", {"read_from_config": "{{ config['option'] }}"}, {"read_from_config": "OPTION"}), - ("test_none_value", {"missing_param": "{{ fake_path['date'] }}"}, {}), + ("test_missing_value", {"missing_param": "{{ fake_path['date'] }}"}, {}), ( "test_parameter_is_interpolated", {"{{ stream_state['date'] }} - {{stream_slice['start_date']}} - {{next_page_token['offset']}} - {{config['option']}}": "ABC"}, {"2021-01-01 - 2020-01-01 - 12345 - OPTION": "ABC"}, ), + ("test_boolean_false_value", {"boolean_false": "{{ False }}"}, {}), + ("test_integer_falsy_value", {"integer_falsy": "{{ 0 }}"}, {}), + ("test_number_falsy_value", {"number_falsy": "{{ 0.0 }}"}, {}), + ("test_string_falsy_value", {"string_falsy": "{{ '' }}"}, {}), + ("test_none_value", {"none_value": "{{ None }}"}, {}), ], ) def test_interpolated_request_params(test_name, input_request_params, expected_request_params): @@ -45,12 +50,17 @@ def test_interpolated_request_params(test_name, input_request_params, expected_r ("test_value_depends_on_stream_slice", {"read_from_slice": "{{ stream_slice['start_date'] }}"}, {"read_from_slice": "2020-01-01"}), ("test_value_depends_on_next_page_token", {"read_from_token": "{{ next_page_token['offset'] }}"}, {"read_from_token": 12345}), ("test_value_depends_on_config", {"read_from_config": "{{ config['option'] }}"}, {"read_from_config": "OPTION"}), - ("test_none_value", {"missing_json": "{{ fake_path['date'] }}"}, {"missing_json": None}), + ("test_missing_value", {"missing_json": "{{ fake_path['date'] }}"}, {"missing_json": None}), ( "test_interpolated_keys", {"{{ stream_state['date'] }}": 123, "{{ config['option'] }}": "ABC"}, {"2021-01-01": 123, "OPTION": "ABC"}, ), + ("test_boolean_false_value", {"boolean_false": "{{ False }}"}, {"boolean_false": False}), + ("test_integer_falsy_value", {"integer_falsy": "{{ 0 }}"}, {"integer_falsy": 0}), + ("test_number_falsy_value", {"number_falsy": "{{ 0.0 }}"}, {"number_falsy": 0.0}), + ("test_string_falsy_value", {"string_falsy": "{{ '' }}"}, {"string_falsy": None}), + ("test_none_value", {"none_value": "{{ None }}"}, {"none_value": None}), ], ) def test_interpolated_request_json(test_name, input_request_json, expected_request_json): From 172d43be1998b2b0a5038cabd199aa6a45faaa29 Mon Sep 17 00:00:00 2001 From: Sergey Chvalyuk Date: Fri, 11 Nov 2022 01:12:17 +0200 Subject: [PATCH 6/8] CHANGELOG.md updated Signed-off-by: Sergey Chvalyuk --- airbyte-cdk/python/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airbyte-cdk/python/CHANGELOG.md b/airbyte-cdk/python/CHANGELOG.md index 1404d4a1cc87e..1e6c098fa2e3c 100644 --- a/airbyte-cdk/python/CHANGELOG.md +++ b/airbyte-cdk/python/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog ## 0.8.1 -Low-code: Don't filter failed interpolated vars for `request_options_provider.request_body_json` +Low-code: Don't filter falsy interpolated vars for `request_options_provider.request_body_json` ## 0.8.0 Low-code: Allow for request and response to be emitted as log messages From decd1f805f0f1388f87a6df48911b03cd4f8890c Mon Sep 17 00:00:00 2001 From: Sergey Chvalyuk Date: Fri, 11 Nov 2022 06:05:11 +0200 Subject: [PATCH 7/8] re-implement Signed-off-by: Sergey Chvalyuk --- airbyte-cdk/python/CHANGELOG.md | 2 +- .../interpolated_request_input_provider.py | 7 ++++--- .../interpolated_request_options_provider.py | 2 +- airbyte-cdk/python/setup.py | 2 +- .../test_interpolated_request_options_provider.py | 12 ++++++------ 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/airbyte-cdk/python/CHANGELOG.md b/airbyte-cdk/python/CHANGELOG.md index f73a823b533a4..1794e82d37953 100644 --- a/airbyte-cdk/python/CHANGELOG.md +++ b/airbyte-cdk/python/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog ## 0.8.2 -Low-code: Don't filter falsy interpolated vars for `request_options_provider.request_body_json` +Low-code: Fix filtering vars in `InterpolatedRequestInputProvider.eval_request_inputs` ## 0.8.1 Low-code: Don't update cursor for non-record messages and fix default loader for connector builder manifests diff --git a/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_input_provider.py b/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_input_provider.py index 05ca70be22ca7..731b7e63e0f35 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_input_provider.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_input_provider.py @@ -21,7 +21,6 @@ class InterpolatedRequestInputProvider: config: Config = field(default_factory=dict) _interpolator: Union[InterpolatedString, InterpolatedMapping] = field(init=False, repr=False, default=None) _request_inputs: Union[str, Mapping[str, str]] = field(init=False, repr=False, default=None) - filter_items: bool = True def __post_init__(self, options: Mapping[str, Any]): @@ -44,6 +43,8 @@ def eval_request_inputs( """ kwargs = {"stream_state": stream_state, "stream_slice": stream_slice, "next_page_token": next_page_token} interpolated_value = self._interpolator.eval(self.config, **kwargs) - if self.filter_items and isinstance(interpolated_value, dict): - interpolated_value = {k: v for k, v in interpolated_value.items() if v} + + if isinstance(interpolated_value, dict): + non_null_tokens = {k: v for k, v in interpolated_value.items() if v is not None} + return non_null_tokens return interpolated_value diff --git a/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_options_provider.py b/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_options_provider.py index 75962ad9bb0aa..5dd5dbda9b35f 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_options_provider.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/declarative/requesters/request_options/interpolated_request_options_provider.py @@ -56,7 +56,7 @@ def __post_init__(self, options: Mapping[str, Any]): config=self.config, request_inputs=self.request_body_data, options=options ) self._body_json_interpolator = InterpolatedRequestInputProvider( - config=self.config, request_inputs=self.request_body_json, options=options, filter_items=False + config=self.config, request_inputs=self.request_body_json, options=options ) def get_request_params( diff --git a/airbyte-cdk/python/setup.py b/airbyte-cdk/python/setup.py index 773743d05205c..16dcdce6e0322 100644 --- a/airbyte-cdk/python/setup.py +++ b/airbyte-cdk/python/setup.py @@ -15,7 +15,7 @@ setup( name="airbyte-cdk", - version="0.8.1", + version="0.8.2", description="A framework for writing Airbyte Connectors.", long_description=README, long_description_content_type="text/markdown", diff --git a/airbyte-cdk/python/unit_tests/sources/declarative/requesters/request_options/test_interpolated_request_options_provider.py b/airbyte-cdk/python/unit_tests/sources/declarative/requesters/request_options/test_interpolated_request_options_provider.py index d4f49dbacea32..59cbcd100c7b4 100644 --- a/airbyte-cdk/python/unit_tests/sources/declarative/requesters/request_options/test_interpolated_request_options_provider.py +++ b/airbyte-cdk/python/unit_tests/sources/declarative/requesters/request_options/test_interpolated_request_options_provider.py @@ -27,9 +27,9 @@ {"{{ stream_state['date'] }} - {{stream_slice['start_date']}} - {{next_page_token['offset']}} - {{config['option']}}": "ABC"}, {"2021-01-01 - 2020-01-01 - 12345 - OPTION": "ABC"}, ), - ("test_boolean_false_value", {"boolean_false": "{{ False }}"}, {}), - ("test_integer_falsy_value", {"integer_falsy": "{{ 0 }}"}, {}), - ("test_number_falsy_value", {"number_falsy": "{{ 0.0 }}"}, {}), + ("test_boolean_false_value", {"boolean_false": "{{ False }}"}, {"boolean_false": False}), + ("test_integer_falsy_value", {"integer_falsy": "{{ 0 }}"}, {"integer_falsy": 0}), + ("test_number_falsy_value", {"number_falsy": "{{ 0.0 }}"}, {"number_falsy": 0.0}), ("test_string_falsy_value", {"string_falsy": "{{ '' }}"}, {}), ("test_none_value", {"none_value": "{{ None }}"}, {}), ], @@ -50,7 +50,7 @@ def test_interpolated_request_params(test_name, input_request_params, expected_r ("test_value_depends_on_stream_slice", {"read_from_slice": "{{ stream_slice['start_date'] }}"}, {"read_from_slice": "2020-01-01"}), ("test_value_depends_on_next_page_token", {"read_from_token": "{{ next_page_token['offset'] }}"}, {"read_from_token": 12345}), ("test_value_depends_on_config", {"read_from_config": "{{ config['option'] }}"}, {"read_from_config": "OPTION"}), - ("test_missing_value", {"missing_json": "{{ fake_path['date'] }}"}, {"missing_json": None}), + ("test_missing_value", {"missing_json": "{{ fake_path['date'] }}"}, {}), ( "test_interpolated_keys", {"{{ stream_state['date'] }}": 123, "{{ config['option'] }}": "ABC"}, @@ -59,8 +59,8 @@ def test_interpolated_request_params(test_name, input_request_params, expected_r ("test_boolean_false_value", {"boolean_false": "{{ False }}"}, {"boolean_false": False}), ("test_integer_falsy_value", {"integer_falsy": "{{ 0 }}"}, {"integer_falsy": 0}), ("test_number_falsy_value", {"number_falsy": "{{ 0.0 }}"}, {"number_falsy": 0.0}), - ("test_string_falsy_value", {"string_falsy": "{{ '' }}"}, {"string_falsy": None}), - ("test_none_value", {"none_value": "{{ None }}"}, {"none_value": None}), + ("test_string_falsy_value", {"string_falsy": "{{ '' }}"}, {}), + ("test_none_value", {"none_value": "{{ None }}"}, {}), ], ) def test_interpolated_request_json(test_name, input_request_json, expected_request_json): From 796275a1e0cbd3101464ee01693d664b2d8118d7 Mon Sep 17 00:00:00 2001 From: Sergey Chvalyuk Date: Fri, 11 Nov 2022 10:35:06 +0200 Subject: [PATCH 8/8] code lint Signed-off-by: Sergey Chvalyuk --- .../python/airbyte_cdk/sources/declarative/auth/oauth.py | 2 +- .../sources/streams/http/requests_native_auth/abstract_oauth.py | 2 +- .../sources/streams/http/requests_native_auth/oauth.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/airbyte-cdk/python/airbyte_cdk/sources/declarative/auth/oauth.py b/airbyte-cdk/python/airbyte_cdk/sources/declarative/auth/oauth.py index 7fc314c7e71fd..97869cc9010a5 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/declarative/auth/oauth.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/declarative/auth/oauth.py @@ -84,7 +84,7 @@ def get_access_token_name(self) -> InterpolatedString: def get_expires_in_name(self) -> InterpolatedString: return self.expires_in_name.eval(self.config) - + def get_grant_type(self) -> InterpolatedString: return self.grant_type.eval(self.config) diff --git a/airbyte-cdk/python/airbyte_cdk/sources/streams/http/requests_native_auth/abstract_oauth.py b/airbyte-cdk/python/airbyte_cdk/sources/streams/http/requests_native_auth/abstract_oauth.py index 843e333cbf075..e7e0ce397e809 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/streams/http/requests_native_auth/abstract_oauth.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/streams/http/requests_native_auth/abstract_oauth.py @@ -117,7 +117,7 @@ def get_expires_in_name(self) -> str: @abstractmethod def get_refresh_request_body(self) -> Mapping[str, Any]: """Returns the request body to set on the refresh request""" - + @abstractmethod def get_grant_type(self) -> str: """Returns grant_type specified for requesting access_token""" diff --git a/airbyte-cdk/python/airbyte_cdk/sources/streams/http/requests_native_auth/oauth.py b/airbyte-cdk/python/airbyte_cdk/sources/streams/http/requests_native_auth/oauth.py index 40d33dd9383d7..5f2e21df88414 100644 --- a/airbyte-cdk/python/airbyte_cdk/sources/streams/http/requests_native_auth/oauth.py +++ b/airbyte-cdk/python/airbyte_cdk/sources/streams/http/requests_native_auth/oauth.py @@ -63,7 +63,7 @@ def get_expires_in_name(self) -> str: def get_refresh_request_body(self) -> Mapping[str, Any]: return self._refresh_request_body - + def get_grant_type(self) -> str: return self._grant_type