When working in Matillion ETL, we often relied on the Python component to connect to Snowflake. A key advantage was the ability to use environment defaults to manage connection parameters, which saved us from creating and updating variables manually.
For example, a typical connection looked like this:
import snowflake.connector
conn = snowflake.connector.connect(
account=environment_endpoint,
user=environment_username,
password=SNOWFLAKE_PASSWORD,
warehouse=environment_port,
database=environment_database,
schema=environment_default_schema,
)
This approach provided a simple, centralized way to manage credentials and configuration, making pipelines easier to maintain.
After moving to Matillion DPC, I noticed that the familiar environment defaults are not directly available in the same way. In ETL, these defaults gave us an easy entry point, but in DPC the setup is different.
The question is: How can we access Snowflake connection details (account, username, warehouse, database, schema) in DPC?
Hi @RemigiousMikevin.James
Thank you for your post, and welcome to the Data Productivity Cloud! In relation to your question, this would be achieved and set in the environment.
I have linked a document that covers this for you here.
If you need anything else, please do not hesitate to ask.
Kind regards, Joe
Hi Joe, Thank you for your response. The question is more towards how we can access the environment default values in python code. Print(globals()) in matillionETL will return list of values for environment_endpoint,environment_username,environment_port,environment_database,environment_default_schema. How can we get this in DPC python component.
Hello @RemigiousMikevin.James
Thanks for your reply, we had a look into this, at the moment it’s not something that is possible. There is an idea raised for this on the Matillion Roadmap, you can find this here. Please vote and share you use case as this helpes the Matillion Product Team prioritise ideas and make them a reality.
In the meantime, if you need anything else, please do not hesitate to ask.
Kind regards, Joe