snowflake.snowpark.functions.is_granted_to_invoker_role¶
- snowflake.snowpark.functions.is_granted_to_invoker_role(role_name: str) Column [source]¶
Returns True if the role returned by the INVOKER_ROLE function inherits the privileges of the specified role in the argument based on the context in which the function is called.
- Parameters:
role_name (str) – The name of the role to check.
_emit_ast (bool, optional) – Whether to emit the abstract syntax tree (AST). Defaults to True.
- Returns:
A Snowflake Column object representing the result of the check.
- Return type:
- Example::
>>> from snowflake.snowpark.functions import lit >>> df = session.create_dataframe([1]) >>> result = df.select(is_granted_to_invoker_role('ANALYST').alias('RESULT')).collect() >>> assert len(result) == 1 >>> assert isinstance(result[0]["RESULT"], bool)