Shane Keller
02/25/2024, 3:07 AMScout
02/25/2024, 3:07 AMos.getenv
method. Here's an example from the documentation:
python
import os
database_name = os.getenv("DATABASE_NAME")
This approach allows you to retrieve the value of an environment variable within an op, but the environment variable itself would need to be set before the pipeline run and would not be specific to an individual op.
If you require more granular control over configuration within specific ops, you might consider using Dagster's config system, which allows you to pass in parameters when you define your pipeline runs. This is not the same as setting environment variables dynamically, but it does allow for dynamic configuration of ops.
For more detailed guidance on how to implement this in your specific use case, you would need to refer to the documentation or consider reaching out to the community for patterns that others may have used in similar situations. Dagster Cloud environment variables and ... button Safe and Easy: Managing Secrets in Dagst... button Using environment variables and secrets ... button Setting Dagster Cloud environment variab... button Thank you for your feedback!