snowpark-python icon indicating copy to clipboard operation
snowpark-python copied to clipboard

SNOW-925266: Session should not close connection when connection provided manually

Open arsatiki opened this issue 2 years ago • 1 comments

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.

arsatiki avatar Sep 27 '23 11:09 arsatiki

This seems reasonable and could be a starter's task. cc @sfc-gh-yixie

sfc-gh-sfan avatar Oct 03 '23 23:10 sfc-gh-sfan