From bbccc645ae56a5267a6ae9f4765b5738d6b6bdf5 Mon Sep 17 00:00:00 2001 From: Derek Visch Date: Fri, 24 Jan 2025 15:48:31 -0500 Subject: [PATCH] didn't work to reduce state size --- tap_sunwave/client.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tap_sunwave/client.py b/tap_sunwave/client.py index 5badb0b..0e5cd10 100644 --- a/tap_sunwave/client.py +++ b/tap_sunwave/client.py @@ -39,6 +39,23 @@ def _request(self, prepared_request: requests.PreparedRequest, context: Context # Then call the parent's method with our newly authenticated request return super()._request(reauthed_request, context) + def _create_in_partitions_list( + self, + partitions: list[dict], + state_partition_context: types.Context, + ) -> dict: + """ + State for this tap is too big and shouldn't be logged by default. This + override only appends partitions to tap_state if this is in an incremental + stream. + + Replaces `singer_sdk.helpers._state._create_in_partitions_list()`. + """ + new_partition_state = {"context": state_partition_context} + if self.replication_key is not None: # OVERRIDE + partitions.append(new_partition_state) + return new_partition_state + @cached_property def authenticator(self) -> Auth: return SunwaveAuthenticator.create_for_stream(self)