vincbeck commented on code in PR #31206:
URL: https://github.com/apache/airflow/pull/31206#discussion_r1192416026
##########
airflow/providers/amazon/aws/transfers/sql_to_s3.py:
##########
@@ -148,9 +148,13 @@ def _fix_dtypes(df: DataFrame, file_format: FILE_FORMAT)
-> None:
for col in df:
if df[col].dtype.name == "object" and file_format == "parquet":
- # if the type wasn't identified or converted, change it to a
string so if can still be
- # processed.
- df[col] = df[col].astype(str)
+ # if the type wasn't identified or converted, try parsing it
to datetime
+ try:
+ df[col] = pd.to_datetime(df[col])
+ df[col].fillna(pd.to_datetime('1970-01-01'),inplace=True)
Review Comment:
Ok but could you add a comment like "Fill this cell with 01/01/70 in case of
None value". That's my understanding of what this line does but I am not sure.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]