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

Guy McCombe

01/30/2023, 7:23 PM
Hey. I have an op with an unconnected input defined as follows:
Copy code
@op(
...
ins={"df": In(input_manager_key="io_manager")}
)
def op_fn(context, df: DataFrame):
    ...
Where
"io_manager"
is an io manager with a
load_input
function. However, this raises a code location error:
DagsterInvalidDefinitionError: Input 'df' of op 'op_fn' has no way of being resolved. Must provide a resolution to this input via another op/graph, or via a direct input value mapped from the top-level graph. To learn more, see the docs for unconnected inputs: <https://docs.dagster.io/concepts/io-management/unconnected-inputs#unconnected-inputs>.
Any ideas on what I’m missing? It looks valid in comparison to the linked docs
dagster bot responded by community 1
FWIW, if anyone else struggles, it looks like it was caused by the type hint in the function parameters
j

jamie

01/31/2023, 3:39 PM
Hi! could you elaborate a bit more? was the type hint incorrect? seems like we could raise a more helpful error message here
g

Guy McCombe

01/31/2023, 3:41 PM
Sure thing! I got the error when I passed the type hint:
df: DataFrame
- I suppose that by giving it a type hint in the arguments instead of in the
In
object it didn’t connect the unconnected input with the argument provided
So my fix was to change to:
Copy code
@op(
ins={"df": In(input_manager_key="io_manager", dagster_type=...)}
)
def op_fn(context, df):
    ...
j

jamie

01/31/2023, 5:51 PM
ahh ok that makes sense. thanks for the clarification! i’ll see if this is something we can catch earlier and give better error messaging around
g

Guy McCombe

01/31/2023, 5:51 PM
Always happy to help. Thanks for your continued support daggy love
2 Views