jamie
05/05/2023, 4:29 PMSnowflakeResource
follows the new Pythonic Config and Resources system. The existing snowflake_resource
will continue to be supported. This SnowflakeResource works slightly differently than the snowflake_resource
. Using the new SnowflakeResource
you create a SnowflakeConnection
(snowflake docs) and use that to run queries
from dagster import asset
from dagster_snowflake import SnowflakeResource
@asset
def my_snowflake_asset(snowflake: SnowflakeResource):
with snowflake.get_connection() as conn:
return (
conn.cursor()
.execute(
"SELECT * FROM IRIS_DATASET WHERE 'petal_length_cm' < 1 AND"
" 'petal_width_cm' < 1"
)
.fetch_pandas_all()
)
Also, if you haven’t yet taken a look at the GitHub discussion about handling timestamp data, please let us know your thoughts!