From 323d7d3b096e02380af57d8bd31468fbdc1d1cad Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Thu, 8 Jun 2023 13:38:18 -0400 Subject: [PATCH] fix test for pandas 2 deviation make pandas bound more liberal --- python/perspective/perspective/tests/table/test_table_pandas.py | 2 ++ python/perspective/setup.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/python/perspective/perspective/tests/table/test_table_pandas.py b/python/perspective/perspective/tests/table/test_table_pandas.py index aba6ca511a..3b6b75a4f3 100644 --- a/python/perspective/perspective/tests/table/test_table_pandas.py +++ b/python/perspective/perspective/tests/table/test_table_pandas.py @@ -776,6 +776,8 @@ def test_table_read_nan_datetime_col(self): def test_table_read_nat_datetime_col(self): data = pd.DataFrame({"str": ["abc", "def"], "datetime": ["NaT", datetime(2019, 7, 11, 11, 0)]}) + # datetime col is `datetime` in pandas<2, `object` in pandas>=2, so convert + data.datetime = pd.to_datetime(data.datetime) tbl = Table(data) assert tbl.schema() == { "index": int, diff --git a/python/perspective/setup.py b/python/perspective/setup.py index d5ebe312eb..41f525f5c2 100644 --- a/python/perspective/setup.py +++ b/python/perspective/setup.py @@ -54,7 +54,7 @@ "ipywidgets>=7.5.1,<9", "future>=0.16.0,<1", "numpy>=1.21.6,<2", - "pandas>=0.22.0,<2.1", + "pandas>=0.22.0,<3", "python-dateutil>=2.8.0,<3", "traitlets>=4.3.2,<6", ]