Jeremy
12/12/2022, 7:07 PMnickvazz
12/12/2022, 7:42 PMJeremy
12/12/2022, 7:43 PMnickvazz
12/12/2022, 7:45 PMJeremy
12/12/2022, 7:45 PMnickvazz
12/12/2022, 7:53 PMJeremy
12/12/2022, 7:55 PMI am not sure how you could turn off the ability to backfill since it sounds like it would corrupt historical data
nickvazz
12/12/2022, 8:00 PMJeremy
12/12/2022, 8:00 PMsandy
12/12/2022, 10:16 PMi want to retain the history of all previous runsdoes this mean that you want to append to the snowflake table each time this runs? or do you want to overwrite it?
Jeremy
12/12/2022, 10:41 PMsandy
12/12/2022, 10:49 PMfrom dagster import asset
from snowflake import connector # pylint: disable=no-name-in-module
from dagster_snowflake.resources import SnowflakeConnection
from snowflake.connector.pandas_tools import pd_writer
@asset
def my_table(context) -> None:
dataframe = ...
connector.paramstyle = "pyformat"
con = SnowflakeConnection(
dict(
schema=...,
connector="sqlalchemy",
database=...,
),
context.log,
).get_connection(raw_conn=False)
dataframe.to_sql(
"my_table",
con=con.engine,
if_exists="append",
index=False,
method=pd_writer,
)
Jeremy
12/12/2022, 11:04 PM