Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDK: allow ConnectorStateManager stream_instance_map to take ConfiguredAirbyteStream or Stream #35000

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

clnoll
Copy link
Contributor

@clnoll clnoll commented Feb 8, 2024

In #34540, the ConnectorStateManager's stream_instance_map was updated to take ConfiguredAirbyteStreams instead of Streams, because at the point where it was being used by the file-based CDK there was a circular dependency that prevented us from having AirbyteStreams available.

However, when revisiting #34716, which updates usages of the ConnectorStateManager, I realized that the methods called by ConnectorStateManager exist on both Stream and AirbyteStream, and so prefer to take the union of the stream types than to have conditional logic that creates a state manager only if a catalog exists, which we'd have to do to update the Stripe connector.

@clnoll clnoll requested a review from a team as a code owner February 8, 2024 02:48
Copy link

vercel bot commented Feb 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Feb 8, 2024 4:12pm

@octavia-squidington-iii octavia-squidington-iii added the CDK Connector Development Kit label Feb 8, 2024
@clnoll clnoll changed the title CDK: allow ConnectorStateManager stream_instance_map to take ConfiguredAirbyteStream (from a catalog) instead of just AirbyteStreams CDK: allow ConnectorStateManager stream_instance_map to take ConfiguredAirbyteStream or Stream Feb 8, 2024
@clnoll clnoll force-pushed the update-state-manager-type branch 2 times, most recently from b389763 to cbb0a30 Compare February 8, 2024 16:04
Copy link
Contributor

@maxi297 maxi297 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you link the issue for the bigger refactor in this PR? Thanks!

@@ -38,7 +38,7 @@ class ConnectorStateManager:

def __init__(
self,
stream_instance_map: Mapping[str, AirbyteStream],
stream_instance_map: Mapping[str, Union[Stream, AirbyteStream]],
state: Optional[Union[List[AirbyteStateMessage], MutableMapping[str, Any]]] = None,
):
shared_state, per_stream_states = self._extract_from_state_message(state, stream_instance_map)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the signature for _extract_from_state_message be changed as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! Updated.

ConfiguredAirbyteStream (from a catalog) instead of just AirbyteStreams
@clnoll
Copy link
Contributor Author

clnoll commented Feb 8, 2024

Here's a the issue to refactor the ConectorStateManger.

@clnoll clnoll merged commit 936ce03 into master Feb 8, 2024
21 checks passed
@clnoll clnoll deleted the update-state-manager-type branch February 8, 2024 16:22
xiaohansong pushed a commit that referenced this pull request Feb 13, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 21, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
jatinyadav-cc pushed a commit to ollionorg/datapipes-airbyte that referenced this pull request Feb 26, 2024
xiaohansong pushed a commit that referenced this pull request Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CDK Connector Development Kit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants