Skip to content

Conversation

@vdonato
Copy link
Collaborator

@vdonato vdonato commented Jan 30, 2023

Just using CI to automagically generate wheel files for the st.connection prototype.

@vdonato vdonato force-pushed the prototype/st.connect branch from e3737e3 to 06e8ea0 Compare January 30, 2023 23:34

Check notice

Code scanning / CodeQL

Statement has no effect

This statement has no effect.

Check notice

Code scanning / CodeQL

Statement has no effect

This statement has no effect.
@vdonato vdonato force-pushed the prototype/st.connect branch from b7aad6c to 110de28 Compare February 1, 2023 03:34
def connection(
connection_class: Literal["sql"], name: str = "default", **kwargs
) -> "SQL":
...

Check notice

Code scanning / CodeQL

Statement has no effect

This statement has no effect.
def connection(
connection_class: Literal["snowpark"], name: str = "default", **kwargs
) -> "Snowpark":
...

Check notice

Code scanning / CodeQL

Statement has no effect

This statement has no effect.
def connection(
connection_class: Literal["files"], name: str = "default", **kwargs
) -> "FileSystem":
...

Check notice

Code scanning / CodeQL

Statement has no effect

This statement has no effect.
def connection(
connection_class: Literal["s3"], name: str = "default", **kwargs
) -> "FileSystem":
...

Check notice

Code scanning / CodeQL

Statement has no effect

This statement has no effect.
connection_class = _get_first_party_connection(connection_class)

try:
return connection_class(

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.

cc @sfc-gh-jcarroll

Copy link
Collaborator Author

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:
Copy link
Contributor

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()

@vdonato vdonato force-pushed the prototype/st.connect branch from a758730 to fec26c4 Compare February 17, 2023 00:59
@vdonato vdonato added the do-not-merge PR is blocked from merging label Feb 17, 2023
@vdonato vdonato force-pushed the prototype/st.connect branch from cafd815 to d8a51a1 Compare February 18, 2023 01:32
def connection(
connection_class: Type[ConnectionClass], name: str = "default", **kwargs
) -> ConnectionClass:
...

Check notice

Code scanning / CodeQL

Statement has no effect

This statement has no effect.
@stale
Copy link

stale bot commented Mar 8, 2023

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.

@stale stale bot added the stale label Mar 8, 2023
@vdonato vdonato removed the stale label Mar 8, 2023
@vdonato
Copy link
Collaborator Author

vdonato commented Mar 15, 2023

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).

@vdonato vdonato closed this Mar 15, 2023
@vdonato vdonato deleted the prototype/st.connect branch June 2, 2023 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge PR is blocked from merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants