diff --git a/Orange/widgets/data/oweditdomain.py b/Orange/widgets/data/oweditdomain.py index 364a1aa30ea..30918cb3322 100644 --- a/Orange/widgets/data/oweditdomain.py +++ b/Orange/widgets/data/oweditdomain.py @@ -2837,11 +2837,6 @@ def datetime_to_epoch(dti: pd.DatetimeIndex, only_time) -> np.ndarray: # when dti has timezone info also the subtracted timestamp must have it # otherwise subtracting fails initial_ts = pd.Timestamp("1970-01-01", tz=None if dti.tz is None else "UTC") - # pandas in versions before 1.4 don't support subtracting different timezones - # remove next two lines when read-the-docs start supporting config files - # for subprojects, or they change default python version to 3.8 - if dti.tz is not None: - dti = dti.tz_convert("UTC") delta = dti - (dti.normalize() if only_time else initial_ts) return (delta / pd.Timedelta("1s")).values diff --git a/Orange/widgets/data/owgroupby.py b/Orange/widgets/data/owgroupby.py index 6e654df5c12..55d5b02893f 100644 --- a/Orange/widgets/data/owgroupby.py +++ b/Orange/widgets/data/owgroupby.py @@ -77,8 +77,6 @@ def var(s): """ if is_datetime64_any_dtype(s): initial_ts = pd.Timestamp("1970-01-01", tz=None if s.dt.tz is None else "UTC") - if s.dt.tz is not None: - s = s.tz_convert("UTC") s = (s - initial_ts) / pd.Timedelta("1s") var_ = s.var() return var_.total_seconds() if isinstance(var_, pd.Timedelta) else var_ diff --git a/Orange/widgets/data/tests/test_oweditdomain.py b/Orange/widgets/data/tests/test_oweditdomain.py index 0881fed3a7d..6c14ef27908 100644 --- a/Orange/widgets/data/tests/test_oweditdomain.py +++ b/Orange/widgets/data/tests/test_oweditdomain.py @@ -957,17 +957,6 @@ def test_as_time(self): np.array(list(chain(expected, expected)), dtype=float).transpose() ) - def test_raise_pandas_version(self): - """ - When this test start to fail: - - remove this test - - remove if clause in datetime_to_epoch function and supporting comments - - remove same if clause in var function in owgroupby (line 77, 78) - - set pandas dependency version to pandas>=1.4 - """ - from datetime import datetime - self.assertLess(datetime.today(), datetime(2023, 1, 1)) - def test_reinterpret_string(self): table = self.data_str domain = table.domain diff --git a/requirements-core.txt b/requirements-core.txt index 1ff6c5ea27e..d1ef618cfe4 100644 --- a/requirements-core.txt +++ b/requirements-core.txt @@ -22,7 +22,7 @@ python-louvain>=0.13 requests openTSNE>=0.6.1 baycomp>=1.0.2 -pandas>=1.3.0,!=1.5.0 +pandas>=1.4.0,!=1.5.0 pyyaml openpyxl httpx>=0.21.0 diff --git a/tox.ini b/tox.ini index ba8dea43c5c..912ce647ac2 100644 --- a/tox.ini +++ b/tox.ini @@ -65,7 +65,7 @@ deps = # oldest: requests oldest: openTSNE==0.6.1 oldest: baycomp==1.0.2 - oldest: pandas==1.3.0 + oldest: pandas==1.4.0 # oldest: pyyaml # oldest: openpyxl oldest: httpx==0.21.0