-
Notifications
You must be signed in to change notification settings - Fork 4k
Add a skeleton implementation of st.experimental_connection #6332
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 a skeleton implementation of st.experimental_connection #6332
Conversation
e785225 to
e2217a3
Compare
e2217a3 to
990c626
Compare
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 this intentionally differs from the prototype (where we pass a validate function to cache_resource) as I'm thinking about moving the underlying connection lifecycle to be managed within the connection class
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 type: ignore and the one below are temporary and will be removed as more of this feature is implemented
27f566e to
3d922c5
Compare
3d922c5 to
1e30f1d
Compare
2f2e8c7 to
95fe2e2
Compare
lukasmasuch
left a comment
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.
LGTM 👍 only aspect that might need to be adapted is were the gather_metrics decorator is placed.
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 assume this will only cover some packages for which we plan to provide native connection implementations? I was wondering if this is actually better placed inside the connection implementation to have it a bit more self-contained. But thinking about the implementation, it does seem to make it messier if we add try / except to all implementations.
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.
Hm, yeah. I think it's pretty close as to which method would be cleaner, but I'd lean toward not requiring every first-party connection implementation to have to do this.
Will keep it as-is for now and potentially change how this works later
95fe2e2 to
89f7b7e
Compare
Note: This PR is going into
feature/st.experimental_connectionand notdevelop.📚 Context
This PR kicks off the work to implement the real version of
st.experimental_connectionthat wasprototyped in #6035. We start off by doing mostly uninteresting stuff:
st.experimental_connectionas part of the public APIBaseConnectionand use it to define types inconnection_factory.pyWhat's currently implemented doesn't really do anything at the moment, but it does define the general
structure of the code we'll be adding for this feature.
The next PR will implement the
BaseConnectionclass, and after that we'll add a few first-party connectors.What kind of change does this PR introduce?
🧪 Testing Done