Ben Smith
06/20/2020, 10:19 PMpath_to_object: my_object.yaml
element in the config of my first solid that adds "my_object" to resources and can be accessed via <http://context.resources.my|context.resources.my>_object
in all later solids.sandy
06/20/2020, 10:52 PMBen Smith
06/21/2020, 12:15 AMschrockn
06/21/2020, 1:02 AMschrockn
06/21/2020, 1:11 AMdef test_dict_resource():
from dagster import pipeline, resource, Permissive, execute_pipeline, ModeDefinition
@resource(config_schema=Permissive())
def dict_resource(init_context):
return init_context.resource_config
@solid(required_resource_keys={'the_dict'})
def consumes_the_dict(context):
assert context.resources.the_dict == {'a': 'b'}
@pipeline(mode_defs=[ModeDefinition(resource_defs={'the_dict': dict_resource})])
def pipe():
consumes_the_dict()
execute_pipeline(pipe, run_config={'resources': {'the_dict': {'config': {'a': 'b'}}}})
schrockn
06/21/2020, 1:12 AMBen Smith
06/21/2020, 1:36 AM