Hi All! There seems to be a discrepancy in the beh...
# ask-community
s
Hi All! There seems to be a discrepancy in the behaviour of environment variables in
dagster.yaml
. The following code
Copy code
retention:
  schedule:
    purge_after_days: 
      env: DAGSTER_SCHEDULE_PURGE # sets retention policy for schedule ticks of all types
  sensor:
    purge_after_days:
      skipped: 
        env: DAGSTER_SENSOR_SKIPPED_PURGE
      failure: 
        env: DAGSTER_SENSOR_FAILURE_PURGE
      success:
        env: DAGSTER_SENSOR_SUCCESS_PURGE
throws
Copy code
raise DagsterInvalidConfigError(
dagster.core.errors.DagsterInvalidConfigError: Errors whilst loading dagster instance config at dagster.yaml.
    Error 1: Invalid scalar at path root:retention:sensor:purge_after_days:failure. Value "{'env': 'DAGSTER_SENSOR_FAILURE_PURGE'}" of type "<class 'dict'>" is not valid for expected type "Int".
    Error 2: Invalid scalar at path root:retention:sensor:purge_after_days:skipped. Value "{'env': 'DAGSTER_SENSOR_SKIPPED_PURGE'}" of type "<class 'dict'>" is not valid for expected type "Int".
    Error 3: Invalid scalar at path root:retention:sensor:purge_after_days:success. Value "{'env': 'DAGSTER_SENSOR_SUCCESS_PURGE'}" of type "<class 'dict'>" is not valid for expected type "Int".
I’m on Dagster 0.15.8
dagster bot resolve to issue 1
o
hi @Sanidhya Singh! Thanks for the report. Currently, the config schema for these values is defined using regular `int`s, rather than the
IntSource
object (which is what allows you to either provide a constant, or use the
env: ENV_VAR
syntax). I filed an issue for this here: https://github.com/dagster-io/dagster/issues/9131
s
Thanks @owen!