Hi everyone, I've been trying to make use of Passi...
# ask-community
d
Hi everyone, I've been trying to make use of Passing Configuration to Multiple Solids in a Pipeline section of https://docs.dagster.io/concepts/configuration/config-schema to try to pass a token as a resource to two separate solids that will need the token. Following the tutorial, I've added
@solid(required_resource_keys={"value"})
to both solids and use them within the solids by
context.resources.value
. I have also added into the pipeline decorator
mode_defs=[ModeDefinition(resource_defs={"value": make_values_resource()})]
and included
run_config={"resources": {"value": {"config": token}}}
in
execute_pipeline
where
token
is my token for both solids in string. Running it with dagit gives me this error
Copy code
/home/dazza/anaconda3/envs/versedai/lib/python3.8/site-packages/dagster/core/workspace/context.py:504: UserWarning: Error loading repository location gather_pipeline.py:dagster.core.errors.DagsterInvalidDefinitionError: Resource key "value" is required by solid def query_NLP_data, but is not provided by mode "default". In mode "default", provide a resource for key "value", or change "value" to one of the provided resources keys: ['io_manager', 'values'].
What have I done wrong here?
c
It looks like the actual resource key passed in to your mode is
values
, not
value