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

Ben

09/13/2022, 11:39 AM
Hello Team, I am changing the fields of a job config and have some troubles using the dagster.Enum: 1. It seems the Enum name (1st argument) has to be unique within a config_schema over all the enums defined? Is it the desired behavior? I don’t see anything about that in the help. Example:
Copy code
@config_mapping(
   config_schema={
              "myTest": Field(Enum("generic", [EnumValue("A"), EnumValue("B")])),
             "myTest2": Field(Enum("generic", [EnumValue("C"), EnumValue("D")])),
   }
myTest Enum does not accept “A” or “B” as defined in the myTest Enum but expect “C” or “D”, like myTest2 2. I wanted to use the python_value of dagster.EnumValue to return a global unique id but: a. Setting an int returns following error when launching the run:
dagster._core.errors.DagsterInvalidConfigError: Error in config for job
Error 1: Value at path rootresourcesglobal_valuesconfigdebug_mode for enum type debug_mode must be a string
File "C:\Users\BB\miniconda3\envs\schemex-379\lib\site-packages\dagster\_grpc\impl.py", line 410, in get_external_execution_plan_snapshot
instance_ref=args.instance_ref,
File "C:\Users\BB\miniconda3\envs\schemex-379\lib\site-packages\dagster\_core\execution\api.py", line 1003, in create_execution_plan
resolved_run_config = ResolvedRunConfig.build(pipeline_def, run_config, mode=mode)
File "C:\Users\BB\miniconda3\envs\schemex-379\lib\site-packages\dagster\_core\system_config\objects.py", line 177, in build
run_config,
b. Setting a string (other than config_value) returns following error when launching the job:
dagster._core.errors.DagsterInvalidConfigError: Error in config for job
Error 1: Value at path rootresourcesglobal_valuesconfigdebug_mode not in enum type debug_mode got id2
File "C:\Users\BB\miniconda3\envs\schemex-379\lib\site-packages\dagster\_grpc\impl.py", line 410, in get_external_execution_plan_snapshot
instance_ref=args.instance_ref,
File "C:\Users\BB\miniconda3\envs\schemex-379\lib\site-packages\dagster\_core\execution\api.py", line 1003, in create_execution_plan
resolved_run_config = ResolvedRunConfig.build(pipeline_def, run_config, mode=mode)
File "C:\Users\BB\miniconda3\envs\schemex-379\lib\site-packages\dagster\_core\system_config\objects.py", line 177, in build
run_config,
>> do I misunderstand the use of python_value? Thanks in advance for your help!
2 Views