| 1 |
Description: Fix FTBFS with pandas 2.0 |
| 2 |
Bug-Debian: https://bugs.debian.org/1044076 |
| 3 |
Author: Andreas Tille <[email protected]>, |
| 4 |
"Rebecca N. Palmer" <[email protected]> |
| 5 |
Forwarded: no, project is archived |
| 6 |
|
| 7 |
--- a/influxdb/tests/dataframe_client_test.py |
| 8 |
+++ b/influxdb/tests/dataframe_client_test.py |
| 9 |
@@ -20,7 +20,7 @@ from .client_test import _mocked_session |
| 10 |
|
| 11 |
if not using_pypy: |
| 12 |
import pandas as pd |
| 13 |
- from pandas.util.testing import assert_frame_equal |
| 14 |
+ from pandas.testing import assert_frame_equal |
| 15 |
from influxdb import DataFrameClient |
| 16 |
import numpy as np |
| 17 |
|
| 18 |
@@ -900,7 +900,7 @@ class TestDataFrameClient(unittest.TestC |
| 19 |
[[23422], [23422], [23422]], columns=['value'], |
| 20 |
index=pd.to_datetime(["2009-11-10T23:00:00Z", |
| 21 |
"2009-11-10T23:00:00Z", |
| 22 |
- "2009-11-10T23:00:00Z"])) |
| 23 |
+ "2009-11-10T23:00:00Z"], format='ISO8601')) |
| 24 |
if pd2.index.tzinfo is None: |
| 25 |
pd2.index = pd2.index.tz_localize('UTC') |
| 26 |
expected = { |
| 27 |
@@ -926,7 +926,7 @@ class TestDataFrameClient(unittest.TestC |
| 28 |
"values": [ |
| 29 |
["2015-01-29T21:55:43.702900257Z", 0.55], |
| 30 |
["2015-01-29T21:55:43.702900257Z", 23422], |
| 31 |
- ["2015-06-11T20:46:02Z", 0.64] |
| 32 |
+ ["2015-06-11T20:46:02.000000000Z", 0.64] |
| 33 |
] |
| 34 |
} |
| 35 |
] |
| 36 |
@@ -949,7 +949,7 @@ class TestDataFrameClient(unittest.TestC |
| 37 |
index=pd.to_datetime([ |
| 38 |
"2015-01-29 21:55:43.702900257+0000", |
| 39 |
"2015-01-29 21:55:43.702900257+0000", |
| 40 |
- "2015-06-11 20:46:02+0000"])) |
| 41 |
+ "2015-06-11 20:46:02.000000000+0000"])) |
| 42 |
if pd1.index.tzinfo is None: |
| 43 |
pd1.index = pd1.index.tz_localize('UTC') |
| 44 |
pd2 = pd.DataFrame( |
| 45 |
@@ -983,7 +983,7 @@ class TestDataFrameClient(unittest.TestC |
| 46 |
0.55, 0.254, np.NaN], |
| 47 |
["2015-01-29T21:55:43.702900257Z", |
| 48 |
23422, 122878, np.NaN], |
| 49 |
- ["2015-06-11T20:46:02Z", |
| 50 |
+ ["2015-06-11T20:46:02.000000000Z", |
| 51 |
0.64, 0.5434, np.NaN] |
| 52 |
] |
| 53 |
} |
| 54 |
@@ -1010,7 +1010,7 @@ class TestDataFrameClient(unittest.TestC |
| 55 |
index=pd.to_datetime([ |
| 56 |
"2015-01-29 21:55:43.702900257+0000", |
| 57 |
"2015-01-29 21:55:43.702900257+0000", |
| 58 |
- "2015-06-11 20:46:02+0000"])) |
| 59 |
+ "2015-06-11 20:46:02.000000000+0000"])) |
| 60 |
|
| 61 |
if pd1.index.tzinfo is None: |
| 62 |
pd1.index = pd1.index.tz_localize('UTC') |
| 63 |
@@ -1021,7 +1021,7 @@ class TestDataFrameClient(unittest.TestC |
| 64 |
index=pd.to_datetime([ |
| 65 |
"2015-01-29 21:55:43.702900257+0000", |
| 66 |
"2015-01-29 21:55:43.702900257+0000", |
| 67 |
- "2015-06-11 20:46:02+0000"])) |
| 68 |
+ "2015-06-11 20:46:02.000000000+0000"])) |
| 69 |
|
| 70 |
if pd1_dropna.index.tzinfo is None: |
| 71 |
pd1_dropna.index = pd1_dropna.index.tz_localize('UTC') |
| 72 |
--- a/influxdb/tests/influxdb08/dataframe_client_test.py |
| 73 |
+++ b/influxdb/tests/influxdb08/dataframe_client_test.py |
| 74 |
@@ -18,7 +18,7 @@ from .client_test import _mocked_session |
| 75 |
|
| 76 |
if not using_pypy: |
| 77 |
import pandas as pd |
| 78 |
- from pandas.util.testing import assert_frame_equal |
| 79 |
+ from pandas.testing import assert_frame_equal |
| 80 |
from influxdb.influxdb08 import DataFrameClient |
| 81 |
|
| 82 |
|
| 83 |
--- a/influxdb/tests/server_tests/client_test_with_server.py |
| 84 |
+++ b/influxdb/tests/server_tests/client_test_with_server.py |
| 85 |
@@ -34,7 +34,7 @@ warnings.simplefilter('error', FutureWar |
| 86 |
|
| 87 |
if not using_pypy: |
| 88 |
import pandas as pd |
| 89 |
- from pandas.util.testing import assert_frame_equal |
| 90 |
+ from pandas.testing import assert_frame_equal |
| 91 |
|
| 92 |
|
| 93 |
THIS_DIR = os.path.abspath(os.path.dirname(__file__)) |