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

Improvements to edge cases of CheckStream #21404

Merged
merged 9 commits into from
Jan 13, 2023
Merged

Conversation

erohmensing
Copy link
Contributor

@erohmensing erohmensing commented Jan 13, 2023

What

CheckStream is meant to check that all of the configuration for connection is provided (e.g. API tokens, headers, etc.). We do this by trying to grab the first record from a stream, which uses all of the connection configuration to perform the record grabbing.

  • If there is no record (the stream is empty), it currently fails, even though we were able to successfully use the configuration to access the empty stream. This PR makes it so that this case is now considered a success.
  • If there are no stream slices (Note: not when stream slice is None!), it currently fails when trying to use the stream slice within the path. This PR makes it so that if there are no stream slices, the check fails, since there is no way to check the complete path of the stream for access.

Fixes KeyError issue surfaced by the introduction of AvailabilityStrategy (see #20891 and #20677 for more context)

🚨 User Impact 🚨

Users who try to perform a check() operation on a source using CheckStream, where at least one of the streams_to_check is empty, will now have success instead of failure checking.

@erohmensing erohmensing requested a review from a team as a code owner January 13, 2023 17:18
@octavia-squidington-iv octavia-squidington-iv added the CDK Connector Development Kit label Jan 13, 2023
Copy link
Contributor

@girarda girarda left a comment

Choose a reason for hiding this comment

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

🎉

@erohmensing erohmensing changed the title Update CheckStream to see successful connection to an empty stream as a success Improvements to edge cases of CheckStream Jan 13, 2023
@erohmensing
Copy link
Contributor Author

@pedroslopez thanks for asking about which edge cases we're trying to handle - adding you if curious. Hope the comments help with that!

@erohmensing erohmensing merged commit d378294 into master Jan 13, 2023
@erohmensing erohmensing deleted the ella/check-empty-stream branch January 13, 2023 21:26
jbfbell pushed a commit that referenced this pull request Jan 13, 2023
* Add test for failure case

* Except StopIteration - make test pass

* Don't attempt to connect to a stream if we get no stream slices

* Make helper method for getting first record for a slice

* Add comments and exit early if stream to check isn't in list of source streams

* move helpers to helper module

* Clarify what it means when StopIteration is returned by helper methods
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