Skip to content

Commit

Permalink
remove inner function argument
Browse files Browse the repository at this point in the history
  • Loading branch information
vkcelik committed Dec 26, 2024
1 parent c23573f commit d5f9792
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/snowflake/snowpark/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -3611,7 +3611,7 @@ def use_secondary_roles(self, roles: Optional[Union[List[str], Literal['all', 'n
References: `Snowflake command USE SECONDARY ROLES <https://docs.snowflake.com/en/sql-reference/sql/use-secondary-roles.html>`_.
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:
Expand All @@ -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: <role_name> [ , <role_name> ... ]
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:
Expand Down

0 comments on commit d5f9792

Please sign in to comment.