itamarst commented on a change in pull request #7169:
URL: https://github.com/apache/arrow/pull/7169#discussion_r427341919
##########
File path: python/pyarrow/pandas_compat.py
##########
@@ -699,6 +699,17 @@ def _reconstruct_block(item, columns=None,
extension_columns=None):
block_arr = item.get('block', None)
placement = item['placement']
+
+ if (
+ (block_arr is not None) and
+ (block_arr.dtype.type == np.datetime64) and
+ (block_arr.dtype.name != "datetime64[ns]")
+ ):
+ # Non-nanosecond timestamps can express much larger values than
+ # nanosecond timestamps, and pandas checks that the values fit into
+ # nanosecond range, so this needs to be an object as dtype.
+ block_arr = block_arr.astype(np.dtype("O"))
Review comment:
I expanded the inline comment to try to explain better.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]