snowpark-python
snowpark-python copied to clipboard
SNOW-925266: Session should not close connection when connection provided manually
What is the current behavior?
Currently it is possible to provide a connection to SessionBuilder using the connection option. This is useful with systems that provide connection creation automatically, e.g. Prefect.
However, regardless of how the connection is passed in, closing the session will always close the connection as well. This is unexpected when the SessionBuilder doesn't create the connection itself.
What is the desired behavior?
It would be good to explicitly say that "do not close the connection" when closing a session. Ideally this would be the default if the connection is passed in, but that might be backwards incompatible.
How would this improve snowflake-snowpark-python?
It'd be less surprising for the usecase where the connection is passed in.
This seems reasonable and could be a starter's task. cc @sfc-gh-yixie