jorisvandenbossche commented on code in PR #35656:
URL: https://github.com/apache/arrow/pull/35656#discussion_r1205211356
##########
python/pyarrow/array.pxi:
##########
@@ -1674,8 +1682,11 @@ cdef _array_like_to_pandas(obj, options, types_mapper):
original_type = obj.type
name = obj._name
- # ARROW-3789(wesm): Convert date/timestamp types to datetime64[ns]
- c_options.coerce_temporal_nanoseconds = True
+ # ARROW-33321 reenables support for date/timestamp conversion in pandas >=
2.0
+ from pyarrow.vendored.version import Version
+ if pandas_api.loose_version < Version('2.0.0'):
+ # ARROW-3789(wesm): Convert date/timestamp types to datetime64[ns]
+ c_options.coerce_temporal_nanoseconds = True
Review Comment:
Should this only be set if the argument was _not_ specified by the user? Or
are we fine with forcing this in case of pandas<2.0, since that's what we did
in the past anyway, and is also the only useful behaviour (letting the user
specify `coerce_temporal_nanoseconds=False` in a conversion to pandas with
pandas<2.0 doesn't make much sense, I suppose, since then pandas will convert
it to nanoseconds anyhow, and the user never sees the non-nanosecond data). So
after writing this: I assume the above is fine ;)
--
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]