clay
02/14/2023, 6:24 PMmy_asset
. I can do this and create a DataFrame without a problem, which I return and from which Dagster creates a table in Snowflake.
@asset
def my_asset(context) -> pd.DataFrame:
with context.resources.snowflake.get_connection() as conn:
with closing(conn.cursor()) as cursor:
q2 = "SELECT * FROM SANDBOX.MY_SCHEMA.MY_TABLE"
cursor.execute(q2)
df = cursor.fetch_pandas_all()
return df
However, if the following step has my_asset
as a dependency, like this...
@asset
def my_next_asset(context, my_asset) -> pd.DataFrame:
stuff...
I get an error:
dagster._check.CheckError: SnowflakeIOManager does not have a handler for type 'typing.Any'. Has handlers for types '<class 'pandas.core.frame.DataFrame'>'. Please add <class 'pandas.core.frame.DataFrame'> type hints to your assets and ops.
Why is it that I can pull the data in to create a DataFrame but the SnowflakeIOManager cannot do it without hints?jamie
02/14/2023, 7:30 PMclay
02/14/2023, 7:47 PM