googleapis/python-db-dtypes-pandas

sort_index raises FutureWarning

tswast opened this issue · 4 comments

tests/compliance/date/test_date_compliance.py::TestMethods::test_value_counts[data_missing-False]
tests/compliance/date/test_date_compliance.py::TestMethods::test_value_counts[data_missing-False]
  /usr/local/Caskroom/miniconda/base/envs/dev-3.9/lib/python3.9/site-packages/pandas/core/indexes/base.py:2177: FutureWarning: Comparison of NaT with datetime.date is deprecated in order to match the standard library behavior. In a future version these will be considered non-comparable.
    return self._engine.is_monotonic_increasing

-- Docs: https://docs.pytest.org/en/stable/warnings.html

Discovered in #84

Bumping down to P3, as I wasn't able to find a quick fix by looking at https://github.com/pandas-dev/pandas/blob/main/pandas/core/arrays/datetimelike.py and it doesn't seem to be affecting correctness.

Also, I see other extension arrays disallow sorting when NA values are present.

https://github.com/pandas-dev/pandas/blob/6033ed4b3383d874ee4a8a461724c0b8c2ca968d/pandas/core/arrays/masked.py#L862-L863

So this particular test might be one we want to disable, anyway?

Possibly fixed in latest pandas, as the warning does not appear with the prerelease dependencies installed.

This warning no longer appears in the compliance testing and all tests pass.
Closing this issue.