ranaroussi / pystore

Fast data store for Pandas time-series data
Apache License 2.0
562 stars 101 forks source link

deprecate 'in' operator to be compatible with pandas 1.2.0 onwards #58

Closed jeremytanjianle closed 2 years ago

jeremytanjianle commented 2 years ago

Previously, line 123 of collection.py would raise warnings of deprecation of using in operator.

if 1 in data.index.nanosecond and "times" not in kwargs:

The exact warning is:

pystore/collection.py:123: FutureWarning: Using the ``in`` operator to test for membership in Series is deprecated. To test for membership in the index use ``(s.index == key).any()``. Similarly to test for membership in the values use ``(s == key).any()``

A simple change to the following removes the FutureWarning in pandas 1.2.0.

if (1 == data.index.nanosecond).any() and "times" not in kwargs: