1

I have one dataframe with a column of date as string.

Date
04/04/22
04/01/22

I convert it to datetime type using pd.to_date(). So the column has a type as datetime64[ns].

Date
2022-04-04
2022-04-01

After that, when I tried loading data to snowflake using df.to_sql("table", con=engine, if_exists="replace", index=False, method=pd_writer) , the snowflake table shows the column as 'iInvalid date'.

I've tried with .dt.date() but then it converts the column back to string. why snowflake is not showing the date properly and why there is not an error when loading the data?

1 Answer 1

0

OK. the answer right now seems to be converting the column from datetime64[ns] to object (date). though it is still object, it is a 'date' object. and when loading the data to snowflake after this change, the date is displayed properly

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.