-
Notifications
You must be signed in to change notification settings - Fork 71
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
Add optional connector connect success and failure callbacks #708
base: main
Are you sure you want to change the base?
Conversation
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.
A fistful of comments.
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.
I like the change😉
I'm still rather against locking on the "client" word, but it's just a name, not a big blocker.
A separate problem I see here is the fact that we don't really test community connectors and I see a ton of changes. A tad too much to be confident that everything will click 🙈
quixstreams/sources/base/source.py
Outdated
@@ -11,7 +11,7 @@ | |||
|
|||
logger = logging.getLogger(__name__) | |||
|
|||
__all__ = ("BaseSource", "Source", "StatefulSource") | |||
ClientConnectCallback = Optional[Callable[[Optional[Exception]], None]] |
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.
This is defined twice. I just realized we don't have a place for a common source/sink code 🤔
Not sure where to put it. Did you think about it?
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.
Yeah, I was thinking we could maybe put something in our quixstreams/utils
, or maybe a new file or folder in root like quixstreams/connector-utils
,
Maybe right now we aren't at the tipping point for common code quite yet, but it did cross my mind for sure.
We also run into similar things with the various connection patterns across all the sources/sinks. Lots of duplicated code here n' there.
What
Provides the ability to add an optional callback for a connection attempt with a connector.
A
setup_client
method is now an additional requirement when constructing a new connector template.How to Use
This feature is fully backwards compatible: usage does not change for users who do not wish to use the callback.
To use it, the pattern is the same across all sources and sinks:
Other things: