Matthew Karas
05/16/2023, 6:31 PMjamie
05/16/2023, 6:37 PMwith_resources
function
@repository
def my_repo():
return with_resources([asset1, asset2], resource_defs={"resource_1": resource_1, "resource_2": resource_2})
here’s a link to some old docs https://docs.dagster.io/1.1.5/concepts/resources#providing-resources-to-software-defined-assetsMatthew Karas
05/16/2023, 7:18 PMjamie
05/16/2023, 7:19 PMMatthew Karas
05/16/2023, 7:20 PMjamie
05/16/2023, 7:22 PMMatthew Karas
05/16/2023, 7:23 PMMatthew Karas
05/16/2023, 7:26 PMclass MyConfig(Config):
setting_a: str
setting_b: str
setting_c: str
@asset(
partitions_def=MY_PARTITION_DEF,
required_resource_keys={"foo", "bar"},
)
def my_asset_i_am_trying_to_get_to_work(
context, config: MyConfig
) -> ReturnedClass:
# code goes here
Matthew Karas
05/16/2023, 7:49 PMjamie
05/16/2023, 8:09 PMfrom pydantic import Field
class MyConfig(Config):
setting_a: str = Field(default="foo")
setting_b: str = Field(default="bar")
setting_c: str # no default
jamie
05/16/2023, 8:09 PMdefine_asset_job
function?Matthew Karas
05/17/2023, 5:06 PM