snowflake.snowpark.functions.is_application_role_in_session¶

snowflake.snowpark.functions.is_application_role_in_session(role_name: str) → Column[source]¶

Verifies whether the application role is activated in the consumer’s current session.

Parameters:
  • role_name (str) – The name of the application role to check.

  • _emit_ast (bool, optional) – Whether to emit the abstract syntax tree (AST). Defaults to True.

Returns:

A Column indicating whether the specified application role is active in the current session.

Example:

>>> df = session.create_dataframe([1])
>>> result = df.select(is_application_role_in_session('ANALYST')).collect()
>>> assert len(result) == 1
>>> assert isinstance(result[0]["IS_APPLICATION_ROLE_IN_SESSION('ANALYST')"], bool)
Copy