While writing the Snowpark code in a Snowsight Python worksheet, how can I select a specific schema? I know I can manually select it using the UI, but I want to select it programmatically.
import snowflake.snowpark as snowpark
from snowflake.snowpark.functions import col
def main(session: snowpark.Session):
df_sql = session.sql("SELECT CURRENT_ACCOUNT(), CURRENT_USER(), CURRENT_ROLE(), CURRENT_WAREHOUSE(), CURRENT_DATABASE(), CURRENT_SCHEMA()")
return df_sql
I have been writing Snowpark code in a Snowsight Python worksheet. While I know that I can manually select a specific schema using the UI, I want to do this programmatically within my code. I have looked through the Snowpark documentation but couldn’t find a clear example or method to set the schema programmatically. I was expecting to find a way to set the schema directly in my Snowpark code, similar to how it can be done in SQL with a USE SCHEMA statement.