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

Davi

09/05/2022, 2:33 PM
Hello, Is there a way of using
configured()
with
resource_defs
? Thank you !
🤖 1
dagster bot responded by community 1
d

Daniel Mosesson

09/05/2022, 2:41 PM
with_resources([...], {'my_resource': orig_resource.configured(...)})
?
d

Davi

09/05/2022, 3:17 PM
I have an
@op
called
read_from_redshift
and I want to configure the resources and configs:
Copy code
table_1 = configured(read_from_redshift,
           name="reading_table_1")(
    {"table": "table_name", "schema": "schema_name"})
Regarding the syntax, how can I apply the
with_resource()
as well ? @Daniel Mosesson
d

Daniel Mosesson

09/05/2022, 3:22 PM
I'm a bit confused. Does what I wrote above make sense to you?
d

Davi

09/05/2022, 3:28 PM
In my example, I achieve to configure the variables table and schema via the configured function. But I did not understand how to update my code with your answer... Sometimes I don't understand perfectly Dagster's syntax. Thank you in advance for your help. @Daniel Mosesson
d

Daniel Mosesson

09/05/2022, 3:29 PM
is table_1 an asset or a resource?
d

Davi

09/05/2022, 3:30 PM
An asset
d

Daniel Mosesson

09/05/2022, 3:31 PM
try
with_resources([table_1], resource_defs)
3 Views