You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Copilot (via GitHub)" <gi...@apache.org> on 2026/07/09 14:28:26 UTC
Re: [PR] GH-48808: [Python] Drop support for Pandas < 2.0.3 [arrow]
Copilot commented on code in PR #50444:
URL: https://github.com/apache/arrow/pull/50444#discussion_r3552391199
##########
python/pyarrow/types.pxi:
##########
@@ -186,9 +186,7 @@ def _get_pandas_tz_type(arrow_type, coerce_to_ns=False):
def _to_pandas_dtype(arrow_type, options=None):
- coerce_to_ns = (options and options.get('coerce_temporal_nanoseconds', False)) or (
- _pandas_api.is_v1() and arrow_type.id in
- [_Type_DATE32, _Type_DATE64, _Type_TIMESTAMP, _Type_DURATION])
+ coerce_to_ns = (options and options.get('coerce_temporal_nanoseconds', False))
Review Comment:
`coerce_to_ns` can end up as `None` (when `options` is `None`) or `{}` (when `options` is an empty dict) because of the `options and ...` expression. While this happens to work via truthiness checks, it’s clearer/safer to make this an explicit boolean `False` unless the option is set.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org