It seems that if a type is not explicitly stated for function parameters decorated by @graph, then they are assumed to be dict types and will fail Dagster type checking. I'm not sure if that's intentional (did not run across it in the docs).
The following two minimum reproductions (hopefully) show this behavior. The first script gives the error, and the does not explicitly specify the parameter type within proper_greeting. Seemingly, the name parameter is assumed to be a dict.
Traceback (most recent call last):
File "/Users/johnss51/Development/python/dagster-schrodinger/bug.py", line 27, in <module>
job.execute_in_process(
File "/Users/johnss51/Development/python/dagster-schrodinger/venv/lib/python3.9/site-packages/dagster/core/definitions/job_definition.py", line 172, in execute_in_process
return core_execute_in_process(
File "/Users/johnss51/Development/python/dagster-schrodinger/venv/lib/python3.9/site-packages/dagster/core/execution/execute_in_process.py", line 34, in core_execute_in_process
execution_plan = create_execution_plan(
File "/Users/johnss51/Development/python/dagster-schrodinger/venv/lib/python3.9/site-packages/dagster/core/execution/api.py", line 753, in create_execution_plan
resolved_run_config = ResolvedRunConfig.build(pipeline_def, run_config, mode=mode)
File "/Users/johnss51/Development/python/dagster-schrodinger/venv/lib/python3.9/site-packages/dagster/core/system_config/objects.py", line 159, in build
raise DagsterInvalidConfigError(
dagster.core.errors.DagsterInvalidConfigError: Error in config for job
Error 1: Value for selector type at path root:inputs:name must be a dict
No Error
By explicitly specifying the type proper_greeting(name: String) the dict assumption goes away and the code runs:
Summary
It seems that if a type is not explicitly stated for function parameters decorated by
@graph
, then they are assumed to bedict
types and will fail Dagster type checking. I'm not sure if that's intentional (did not run across it in the docs).The following two minimum reproductions (hopefully) show this behavior. The first script gives the error, and the does not explicitly specify the parameter type within
proper_greeting
. Seemingly, thename
parameter is assumed to be adict
.The second script does not have an error, and the only difference is explicitly specifying the parameter type within
proper_greeting
.Reproduction
Gives Error
Gives the following error:
No Error
By explicitly specifying the type
proper_greeting(name: String)
thedict
assumption goes away and the code runs:Gives the following successful output:
Additional Info about Your Environment
Mac OS X 11.6.1 Python 3.9.7 dagster==0.13.18
Message from the maintainers:
Impacted by this bug? Give it a 👍. We factor engagement into prioritization.