GitHub user mtsadler-branch closed the discussion with a comment:
apache-airflow-providers-snowflake: 5.3.1
For anyone stumbling across this thread, if you cast the `datetime64[ns]` to
formatted strings before `.to_sql(...)` it seems to resolve the issue.
```
date_cols = df.select_dtypes(include=['datetime64[ns]']).columns
for col in date_cols:
df[col] = df[col].dt.strftime('%Y-%m-%dT%H:%M:%SZ')
engine = hook.get_sqlalchemy_engine()
with engine.connect() as conn:
df.to_sql(
name=table_name,
con=conn,
if_exists="append",
index=False,
method=pd_writer,
)
```
GitHub link:
https://github.com/apache/airflow/discussions/38712#discussioncomment-11596836
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]