Skip to content

Commit 1065562

Browse files
authored
Airbyte CDK: move deprecated decorator (#44023)
Signed-off-by: Artem Inzhyyants <[email protected]>
1 parent 9271636 commit 1065562

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

airbyte-cdk/python/airbyte_cdk/sources/streams/core.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ class StreamClassification:
105105
has_multiple_slices: bool
106106

107107

108+
# Moved to class declaration since get_updated_state is called on every record for incremental syncs, and thus the @deprecated decorator as well.
109+
@deprecated(
110+
version="0.1.49",
111+
reason="Deprecated method get_updated_state, You should use explicit state property instead, see IncrementalMixin docs.",
112+
action="ignore",
113+
)
108114
class Stream(ABC):
109115
"""
110116
Base abstract class for an Airbyte Stream. Makes no assumption of the Stream's underlying transport protocol.
@@ -398,7 +404,6 @@ def state_checkpoint_interval(self) -> Optional[int]:
398404
"""
399405
return None
400406

401-
@deprecated(version="0.1.49", reason="You should use explicit state property instead, see IncrementalMixin docs.", action="ignore")
402407
def get_updated_state(
403408
self, current_stream_state: MutableMapping[str, Any], latest_record: Mapping[str, Any]
404409
) -> MutableMapping[str, Any]:

airbyte-cdk/python/unit_tests/sources/test_source.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def abstract_source(mocker):
8383
mocker.patch.multiple(HttpStream, __abstractmethods__=set())
8484
mocker.patch.multiple(Stream, __abstractmethods__=set())
8585

86-
class MockHttpStream(HttpStream, mocker.MagicMock):
86+
class MockHttpStream(mocker.MagicMock, HttpStream):
8787
url_base = "http://example.com"
8888
path = "/dummy/path"
8989
get_json_schema = mocker.MagicMock()

0 commit comments

Comments
 (0)