I've been happily using dataframe to SQL in pandas, but the issue i'm having is that now I need to customize beyond the command and include a SQL statement to copy grants as I want to refresh a table by replacing it, but I don't want to lose the grants on it.
Since it's a function for which I cannot see the underlying SQL and add the grant statement, wondering if there's any work arounds/ what I can do.
(DF to SQL documentation) https://pandas.pydata.org/pandas-docs/version/0.23.4/generated/pandas.DataFrame.to_sql.html
(Snowflake create table documentation that includes copy grants for replacements as an option) https://docs.snowflake.com/en/sql-reference/sql/create-table.html
connection = engine.connect()
df.to_sql("Testtable", con=engine, index=False,chunksize=16000, if_exists='replace')