Simrun Basuita
05/17/2023, 1:47 PMCREATE TABLE ....
), how can I get downstream assets to load that using snowflake_pandas_io_manager
? i.e. how to declare that the asset lives in snowflake?jamie
05/17/2023, 2:07 PM@asset
def my_table():
# pseudocode! not real snowflake methods
snowflake.execute("CREATE TABLE my_db.my_schema.my_table")
@asset
def downstream(my_table: pd.DataFrame):
# do stuff
defs = Definitions(
assets=[my_table, downstream],
resources={
"io_manager": SnowflakePandasIOManager(database="my_db", schema="my_schema", account=..., ...)
}
)
Simrun Basuita
05/17/2023, 3:22 PMjamie
05/18/2023, 2:52 PMdownstream
needs to be stored as a blob somewhere? you can set the io manager on my_table
to snowflake pandas, and the io manager on downstream
to whatever you want it to be. The io manager attached to my_table
will always be used to load my_table
in a downstream asset
@asset(
io_manager_key="snowflake_pandas"
)
def my_table():
...
@asset(
io_manager_key="s3"
)
def downstream(my_table):
...
defs = Definitions(
assets=[my_table, downstream],
resources={
"snowflake_pandas": SnowflakePandasIOManager(database="my_db", schema="my_schema", account=..., ...)
"s3": ...
}
)
Simrun Basuita
05/18/2023, 3:46 PMmy_table
function, so the I/O manager never actually gets invoked when it's run.jamie
05/18/2023, 4:59 PMSimrun Basuita
05/18/2023, 7:32 PM