Binoy Shah
01/18/2023, 5:17 PMdagster-snowflake-pandas
, when an @asset
function returns a Data Frame, does Dagster download the data into Dataframe and hold it in memory?
If yes, what mechanism does it use to download and build a Panda dataframe?
Can it be possible to convert into a Polars dataframe ?jamie
01/18/2023, 8:39 PMpd.read_sql
method to do this (here’s the line in the source code).
If you wanted to download as a Polars dataframe, you could write a new type handler for the snowflake io manager. This process isn’t documented right now (it’s a pretty new internal feature, and writing docs for it is on my to do list). I’m happy to help walk you through the process though if that’s something you’re interested inBinoy Shah
01/18/2023, 9:04 PMDbTypeHandler
like https://github.com/dagster-io/dagster/blob/master/python_modules/libraries/dagster[…]andas/dagster_snowflake_pandas/snowflake_pandas_type_handler.py
And “registering” it someplace to have it injected during load/unload ?jamie
01/18/2023, 9:07 PMbuild_snowflake_io_manager
command like this https://github.com/dagster-io/dagster/blob/master/python_modules/libraries/dagster[…]andas/dagster_snowflake_pandas/snowflake_pandas_type_handler.pyjamie
01/18/2023, 9:10 PMhandle_output
method of the type handler is called, and that method is responsible for actually uploading the output to snowflakeBinoy Shah
01/18/2023, 9:12 PMPUT
snowflake command to upload the parquet file and then COPY
snowflake command to create/upsert table entries.Binoy Shah
01/18/2023, 9:12 PMUNLOAD/GET
to download the data ?jamie
01/18/2023, 9:14 PMjamie
01/18/2023, 9:47 PMjamie
01/18/2023, 9:49 PMjamie
01/18/2023, 9:49 PM