graingert commented on code in PR #38040: URL: https://github.com/apache/arrow/pull/38040#discussion_r1347591247
########## python/pyarrow/pandas_compat.py: ########## @@ -36,6 +36,17 @@ from pyarrow.lib import _pandas_api, frombytes # noqa +try: + _np_unicode = np.unicode_ +except AttributeError: + _np_unicode = np.str_ + +try: + _np_sctypes = np.sctypes +except AttributeError: + from numpy.core.numerictypes import sctypes as _np_sctypes Review Comment: yep looks like this code can be simplified a lot ```python >>> import numpy as np >>> np.__version__ '1.16.6' >>> np.unicode_ is np.str_ True >>> np.NaN is np.nan True >>> from numpy.core.numerictypes import sctypes >>> np.sctypes is sctypes True >>> ``` -- 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]
