Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pyarrow: Support date32[day] and date64[ms] dtypes in pandas objects (#…
…2845) * Convert pyarrow date32/date64 dtypes to np.datetime64 Handle date columns in pandas.DataFrame with pyarrow dtypes like date32[day][pyarrow] or date64[ms][pyarrow] by modifying the vectors_to_arrays conversion function. Added some parametrized unit tests to test_info.py to ensure this works. * Handle Python lists without dtype attr and use as_c_contiguous Need to handle Python lists that don't have the dtype attribute, unlike pandas.Series objects. Also ensure that we return a C-contiguous array. * Add doctest to check that date32/date64 are converted to datetime64 Ensure that pyarrow date32 and date64 dtypes are converted to numpy.datetime64 dtype. Added pyarrow dependency to ci_doctests.yaml. Also changed from using `"date" in vec_dtype` to `vec_dtype.startswith("date")`. * Refactor to use pygmt.helpers.testing.skip_if_no * Document that PyArrow date32/date64 dtypes are now supported in PyGMT * Refactor to use dict mapping instead of if-then --------- Co-authored-by: Dongdong Tian <[email protected]>
- Loading branch information