File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -1793,6 +1793,7 @@ def _to_corrected_pandas_type(dt):
17931793 """
17941794 When converting Spark SQL records to Pandas DataFrame, the inferred data type may be wrong.
17951795 This method gets the corrected data type for Pandas if that type may be inferred uncorrectly.
1796+ NOTE: DateType is inferred incorrectly as 'object', TimestampType is correct with datetime64[ns]
17961797 """
17971798 import numpy as np
17981799 if type (dt ) == ByteType :
@@ -1803,7 +1804,7 @@ def _to_corrected_pandas_type(dt):
18031804 return np .int32
18041805 elif type (dt ) == FloatType :
18051806 return np .float32
1806- elif type (dt ) == DateType or type ( dt ) == TimestampType :
1807+ elif type (dt ) == DateType :
18071808 return 'datetime64[ns]'
18081809 else :
18091810 return None
You can’t perform that action at this time.
0 commit comments