Hello Community!
I’m exploring ways to enhance my development workflow with Code Repositories, and I was wondering if there’s a method to work locally in Foundry, similar to how one might develop using Snowpark. Specifically, I’d like to connect to Snowflake from my local environment and run code on demand. I can see now that there is an available feature to clone the repo to a local environment, but still I can’t stablish the Spark session.
For example, in a Snowpark environment, I can do something like this:
from snowflake.snowpark import Session, functions as F, types as T, Window
def create_snowflake_session():
connection_parameters = {
"account": os.getenv('ACCOUNT'),
"user": os.getenv('USERNAME'),
"password": os.getenv('PASSWORD'),
"role": os.getenv('ROLE'),
"warehouse": os.getenv('WAREHOUSE')
}
session = Session.builder.configs(connection_parameters).create()
return session
session = create_snowflake_session()
table = session.read.table('DB.SCHEMA.TABLE')
table.show()
Is there a way to achieve something similar within the Foundry ecosystem, allowing for local development with a connection to the Foundry runners? Any guidance or best practices would be greatly appreciated!
Thanks in advance!