snowflake.snowpark.functions.getvariable¶
- snowflake.snowpark.functions.getvariable(name: str) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.43.0/src/snowflake/snowpark/_functions/scalar_functions.py#L497-L512)¶
Retrieves the value of a session variable by its name.
- Parameters:
name (str) – The name of the session variable to retrieve.
- Returns:
A Snowflake Column object representing the value of the specified session variable.
- Return type:
- Example::
>>> result = session.create_dataframe([1]).select(getvariable("MY_VARIABLE").alias("RESULT")).collect() >>> assert result[0]["RESULT"] is None