Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
feat(airbyte-cdk): Have better fallback error message #43399
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
feat(airbyte-cdk): Have better fallback error message #43399
Changes from 1 commit
fff61ef
ce95ae6
483ea87
82f4a48
5b20bd1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the interface does not accept
None
like theinterpret_response
does. I started a conversation in our private slack. Basically:In which case can response_or_exception be None? The typing says that it is optional but the only call where response_or_exception is not a passthrough(
airbyte/airbyte-cdk/python/airbyte_cdk/sources/streams/http/http_client.py
Line 257 in 99a33cb
None
.I’m asking because:
response_or_exception
AttributeError: 'NoneType' object has no attribute X
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Until we figure this out, this will generate mypy issues as seen here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the Slack thread, is the proposal to modify the
interpret_response()
method interface to no longer beOptional[blahblah]
? And that would be the solve for typing isses sinceinterpret_response()
->create_fallback_error_resolution()
will be passing the union now.I'm not opposed to that, but are worried about all the backwards compatibility headaches? since we do have some uses of the various
DefaultErrorHandlers
that technically still adhere to the same interface?Would the alternative to the mypy fix be to add a type check or None check around the calls to
create_fallback_error_resolution()
to guarantee it's notNone
, even though we're confident it never is. I didn't test myself, but I'm curious if that would make mypy stop complainingOr the alternative alternative is just an
ignore
lolThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed that it is a bigger change. Let's decouple the typing change from this change then. I'll just have the error message be something like "Unexpected argument while handling error." and add a comment that we expect this not to happen