Hi all, I hope you'r good :) One question : My go...
# ask-community
m
Hi all, I hope you'r good :) One question : My goal is to be sure the connection is OK before executing extraciton assets. I tried to do it with a @CREATE_CONNECTION asset passing the connection object to @EXTRACT_ASSETS, if the connection is valid. How we can do it ? I think it's related to 'dagster type' but did'nt manage to make it work … Thanks for your help :) Example code of what i try to acheive :
@asset(key_prefix=["ETL"],compute_kind="Connection")
def CREATE_CONNECTION():
my_connection = RFC(user="xxxx",
passwd="xxxxx", system="xxxx")
return my_connection
@asset(key_prefix=["ETL"])
def EXTRACT_TABLE(CREATE_CONNECTION):
DATA = CREATE_CONNECTION.get_table(arg…)
return DATA
dagster bot responded by community 1
v
Instead of putting the connection in an asset, which is meant to represent a persistent data object, you should wrap it in a
ResourceDefinition
https://docs.dagster.io/concepts/resources When using resources, the computation for the asset/job/op will only kick off once the resource is done initializing
❤️ 1
m
I will try this appoach, thanks :)