David Weber
05/23/2023, 9:40 AMdagster
to load env variables, and using the os
library?
e.g. EnvVar("MY_VAR")
or os.getenv("MY_VAR")
Using dagsters EnvVar
resulted in an error for me, as it was returning MY_VAR
instead of the value of MY_VAR
- which seems really odd to me. Using os.getenv
works fine.
If there is any documentation that explains the behavior of EnvVar
, happy to see it! I couldn't find it 🙂
Thanks!David Weber
05/23/2023, 9:44 AMJustin Taylor
05/23/2023, 10:25 AMEnvVar
is meant to be used for configurable Dagster objects, while os.getenv
can be used in your code when you want to pass environment variables to non-Dagster objects without using configurable objects. In my experience, when you use EnvVar
with configurable Dagster objects, you are able to better manage environment variables, as well as keep them hidden in the UI.David Weber
05/23/2023, 11:03 AM