snowflake.snowpark.functions.getvariable¶

snowflake.snowpark.functions.getvariable(name: str) → Column[source]¶

Retrieves the value of a session variable by its name.

Parameters:
  • name (str) – The name of the session variable to retrieve.

  • _emit_ast (bool, optional) – A flag indicating whether to emit the abstract syntax tree (AST). Defaults to True.

Returns:

A Snowflake Column object representing the value of the specified session variable.

Return type:

Column

Example::
>>> result = session.create_dataframe([1]).select(getvariable("MY_VARIABLE").alias("RESULT")).collect()
>>> assert result[0]["RESULT"] is None
Copy