diff --git a/src/snowflake/snowpark/session.py b/src/snowflake/snowpark/session.py index a8e20279a9a..6aac9832260 100644 --- a/src/snowflake/snowpark/session.py +++ b/src/snowflake/snowpark/session.py @@ -3611,7 +3611,7 @@ def use_secondary_roles(self, roles: Optional[Union[List[str], Literal['all', 'n References: `Snowflake command USE SECONDARY ROLES `_. Args: - roles: list of specific roles or "all" or "none". ``None`` means "none". + roles: 'all' or list of specific roles or 'none'. ``None`` means 'none'. Example 1 Use specific roles as secondary roles: @@ -3629,16 +3629,16 @@ def use_secondary_roles(self, roles: Optional[Union[List[str], Literal['all', 'n >>> session.use_secondary_roles('none') """ - def format_roles(value): + def format_roles(): if not roles: return 'none' - if isinstance(value, List): + if isinstance(roles, List): # format the list according to syntax: [ , ... ] return ', '.join(roles) - return value.lower() + return roles.lower() self._run_query( - f"use secondary roles {format_roles(roles)}" + f"use secondary roles {format_roles()}" ) def _use_object(self, object_name: str, object_type: str) -> None: