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

connector builder: Set state on stream slices #37109

Merged
merged 4 commits into from
Apr 18, 2024
Merged

Conversation

girarda
Copy link
Contributor

@girarda girarda commented Apr 12, 2024

What

Update the builder's message grouper to set the state on the output stream slices.

The BE server does not need to be updated, but we'll need to update the webapp to display them.

Solves a part of https://github.com/airbytehq/airbyte-internal-issues/issues/1561

How

  • Keep track of the latest state message emitted by the source
  • Set the latest state on the stream slice before yielding it

Example response from the server:
Screenshot 2024-04-15 at 10 24 53 AM

Copy link

vercel bot commented Apr 12, 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 Apr 15, 2024 4:26pm

@octavia-squidington-iii octavia-squidington-iii added the CDK Connector Development Kit label Apr 12, 2024
@girarda girarda marked this pull request as ready for review April 15, 2024 17:25
@girarda girarda requested a review from a team as a code owner April 15, 2024 17:25
@girarda girarda requested a review from lmossman April 15, 2024 17:26
Copy link
Contributor

@brianjlai brianjlai left a comment

Choose a reason for hiding this comment

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

looks good to me. I find it curious that we've had state in StreamReadSlices and our open API spec this whole time, but we just never bothered to populate it until now

Comment on lines +226 to +227
elif message.type == MessageType.STATE:
latest_state_message = message.state
Copy link
Contributor

Choose a reason for hiding this comment

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

@girarda my understanding of this feature was that every slice would output its own state message, so we would expect every item in the slices response of the read_stream request to contain a state object.

But when I tested this, only the last slice had a state in the response of read_stream.

Is this expected that only the last slice will ever output a state message? If so, why does this happen instead of each slice outputting a state?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

how did you test this? My initial hypothesis is this might be because we don't necessarily produce a stream slice due to record and page limits but I can dig more into the issue

Copy link
Contributor

Choose a reason for hiding this comment

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

I used the exchange rates connector that you build in the tutorial:
exchange_rates.yaml

And I pointed my local connector builder server at the local CDK on this branch

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue is that the builder server submits a request for a full refresh read instead of incremental. Fix is here https://github.com/airbytehq/airbyte-platform-internal/pull/12179

@girarda girarda requested a review from lmossman April 18, 2024 21:12
Copy link
Contributor

@lmossman lmossman left a comment

Choose a reason for hiding this comment

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

With the fix for the sync mode in https://github.com/airbytehq/airbyte-platform-internal/pull/12179, this is now working as expected for me when used with the Builder

@girarda girarda merged commit a2e908d into master Apr 18, 2024
35 checks passed
@girarda girarda deleted the alex/builder_state branch April 18, 2024 23:16
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

4 participants