Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/snowflake/snowpark/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -3269,6 +3269,24 @@ def get_session_stage(
These artifacts include libraries and packages for UDFs that you define
in this session via :func:`add_import`.

The return value is a Snowflake stage reference beginning with ``@``,
not a local directory or the contents of a file. Pass it to file
operations such as :meth:`FileOperation.put` to upload artifacts to
Snowflake. Treat this session-scoped temporary storage as disposable,
not as a permanent location for application data.

Example::

>>> stage = session.get_session_stage() # doctest: +SKIP
>>> stage.startswith("@") # doctest: +SKIP
True
>>> session.get_session_stage() == stage # doctest: +SKIP
True

The stage name is generated by Snowpark, so don't hardcode the name
returned by another session. The first call can create a temporary
stage in Snowflake and requires a connection with appropriate privileges.

Note:
This temporary stage is created once under the current database and schema of a Snowpark session.
Therefore, if you switch database or schema during the session, the stage will not be re-created
Expand Down
Loading