Skip to content

Commit

Permalink
Merge pull request #16 from MeltanoLabs/state_size_too_alrge
Browse files Browse the repository at this point in the history
State size too large
  • Loading branch information
visch authored Jan 24, 2025
2 parents 6b681a9 + bbccc64 commit 1a18984
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tap_sunwave/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1a18984

Please sign in to comment.