-
Notifications
You must be signed in to change notification settings - Fork 4k
[DO NOT MERGE] Add prototype implementations of st.connect, BaseConnection, and SQL (connector) #6035
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
Conversation
e3737e3 to
06e8ea0
Compare
b7aad6c to
110de28
Compare
| def connection( | ||
| connection_class: Literal["snowpark"], name: str = "default", **kwargs | ||
| ) -> "Snowpark": | ||
| ... |
Check notice
Code scanning / CodeQL
Statement has no effect
| def connection( | ||
| connection_class: Literal["files"], name: str = "default", **kwargs | ||
| ) -> "FileSystem": | ||
| ... |
Check notice
Code scanning / CodeQL
Statement has no effect
| def connection( | ||
| connection_class: Literal["s3"], name: str = "default", **kwargs | ||
| ) -> "FileSystem": | ||
| ... |
Check notice
Code scanning / CodeQL
Statement has no effect
| connection_class = _get_first_party_connection(connection_class) | ||
|
|
||
| try: | ||
| return 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.
@vdonato For the sake of metrics, could we separate out just this part of the function, and wrap that in @gather_metrics? That way we would always have an actual Connection Class, so we can tell what kind of connection it is, rather than sometimes having a class, and sometimes having a string.
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.
Ack -- I'm just starting the productionization of this code into what we'll be merging into develop, so will do this in the new feature branch being created
| # In the future, we may decide that we do want to send that test query each | ||
| # time this method is called, but in doing so, we will be adding a small amount | ||
| # of additional load to each script run. | ||
| with self._lock: |
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 isn't exactly true. There is not a is_closed() method in a Snowpark Session, however there is a is_closed() method in a SnowflakeConnection object, and the Snowpark Session contains a SnowflakeConnection. That is, you could return: not self.instance._conn._conn.is_closed()
a758730 to
fec26c4
Compare
…on (#6049) * Add File connection (WIP) * Fix some typing and import issues * Change File -> FileSystem and support shortcuts for s3 and gcs * Add better support in snowpark connection
cafd815 to
d8a51a1
Compare
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
Going to close this PR out as I'll be building the productionized / hardened version of this feature in the feature/st.experimental_connection branch so that we can keep the prototype and final implementation work separate (even though I'm imagining that a decent amount of this code can just be copied into new branch). |
Just using CI to automagically generate wheel files for the
st.connectionprototype.