https://dagster.io/ logo
#ask-community
Title
# ask-community
c

Charles Leung

04/18/2022, 2:09 PM
Hey all, I have a question with dagster.StringSource. How do i set the default value to pick up from environment variables? For example:
Copy code
"gcp_project": dagster.Field(
            dagster.StringSource,
            description="project name",
            is_required=False,
            default_value=os.getenv("GCP_PROJECT", "my-gcp-project"),
        ),
The default_value doesn't seem like the most "dagster" way to do it. Should it be {env: GCP_PROJECT}?
d

daniel

04/18/2022, 3:33 PM
Hey Charles -
default_value={"env": "GCP_PROJECT"}
looks right to me, yeah
c

Charles Leung

04/18/2022, 4:28 PM
thanks daniel! i'll test this out.
worked great 🙂 thanks alot!
condagster 1
2 Views