Accepting request 1093763 from devel:languages:python

OBS-URL: https://build.opensuse.org/request/show/1093763
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-influxdb?expand=0&rev=12
This commit is contained in:
Dominique Leuenberger 2023-06-19 20:50:46 +00:00 committed by Git OBS Bridge
commit e705cb7eaf
3 changed files with 96 additions and 0 deletions

View File

@ -0,0 +1,88 @@
Index: influxdb-5.3.1/influxdb/tests/dataframe_client_test.py
===================================================================
--- influxdb-5.3.1.orig/influxdb/tests/dataframe_client_test.py
+++ influxdb-5.3.1/influxdb/tests/dataframe_client_test.py
@@ -19,7 +19,10 @@ from .client_test import _mocked_session
if not using_pypy:
import pandas as pd
- from pandas.util.testing import assert_frame_equal
+ try:
+ from pandas.testing import assert_frame_equal
+ except ImportError:
+ from pandas.util.testing import assert_frame_equal
from influxdb import DataFrameClient
import numpy as np
@@ -947,7 +950,7 @@ class TestDataFrameClient(unittest.TestC
index=pd.to_datetime([
"2015-01-29 21:55:43.702900257+0000",
"2015-01-29 21:55:43.702900257+0000",
- "2015-06-11 20:46:02+0000"]))
+ "2015-06-11 20:46:02+0000"], format='ISO8601'))
if pd1.index.tzinfo is None:
pd1.index = pd1.index.tz_localize('UTC')
pd2 = pd.DataFrame(
@@ -1008,7 +1011,7 @@ class TestDataFrameClient(unittest.TestC
index=pd.to_datetime([
"2015-01-29 21:55:43.702900257+0000",
"2015-01-29 21:55:43.702900257+0000",
- "2015-06-11 20:46:02+0000"]))
+ "2015-06-11 20:46:02+0000"], format='ISO8601'))
if pd1.index.tzinfo is None:
pd1.index = pd1.index.tz_localize('UTC')
@@ -1019,7 +1022,7 @@ class TestDataFrameClient(unittest.TestC
index=pd.to_datetime([
"2015-01-29 21:55:43.702900257+0000",
"2015-01-29 21:55:43.702900257+0000",
- "2015-06-11 20:46:02+0000"]))
+ "2015-06-11 20:46:02+0000"], format='ISO8601'))
if pd1_dropna.index.tzinfo is None:
pd1_dropna.index = pd1_dropna.index.tz_localize('UTC')
Index: influxdb-5.3.1/influxdb/tests/influxdb08/dataframe_client_test.py
===================================================================
--- influxdb-5.3.1.orig/influxdb/tests/influxdb08/dataframe_client_test.py
+++ influxdb-5.3.1/influxdb/tests/influxdb08/dataframe_client_test.py
@@ -16,7 +16,10 @@ from .client_test import _mocked_session
if not using_pypy:
import pandas as pd
- from pandas.util.testing import assert_frame_equal
+ try:
+ from pandas.testing import assert_frame_equal
+ except ImportError:
+ from pandas.util.testing import assert_frame_equal
from influxdb.influxdb08 import DataFrameClient
Index: influxdb-5.3.1/influxdb/tests/server_tests/client_test_with_server.py
===================================================================
--- influxdb-5.3.1.orig/influxdb/tests/server_tests/client_test_with_server.py
+++ influxdb-5.3.1/influxdb/tests/server_tests/client_test_with_server.py
@@ -34,7 +34,10 @@ warnings.simplefilter('error', FutureWar
if not using_pypy:
import pandas as pd
- from pandas.util.testing import assert_frame_equal
+ try:
+ from pandas.testing import assert_frame_equal
+ except ImportError:
+ from pandas.util.testing import assert_frame_equal
THIS_DIR = os.path.abspath(os.path.dirname(__file__))
Index: influxdb-5.3.1/influxdb/_dataframe_client.py
===================================================================
--- influxdb-5.3.1.orig/influxdb/_dataframe_client.py
+++ influxdb-5.3.1/influxdb/_dataframe_client.py
@@ -219,7 +219,7 @@ class DataFrameClient(InfluxDBClient):
else:
key = (name, tuple(sorted(tags.items())))
df = pd.DataFrame(data)
- df.time = pd.to_datetime(df.time)
+ df.time = pd.to_datetime(df.time, format='mixed')
if data_frame_index:
df.set_index(data_frame_index, inplace=True)

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Jun 19 08:47:41 UTC 2023 - Fabian Vogt <fvogt@suse.com>
- Add patch to fix tests with newer pandas:
* python-influxdb-new-pandas.patch
-------------------------------------------------------------------
Fri Jun 2 08:59:55 UTC 2023 - pgajdos@suse.com

View File

@ -32,6 +32,8 @@ Patch0: python-influxdb-remove-nose.patch
Patch1: https://github.com/influxdata/influxdb-python/pull/845.patch#/influxdb-pr845-pandas-future.patch
# do not require six (repo archived in favour of influxdb2, not reporting)
Patch2: python-influxdb-no-six.patch
# fix tests with newer pandas
Patch3: python-influxdb-new-pandas.patch
BuildRequires: %{python_module python-dateutil >= 2.6.0}
BuildRequires: %{python_module pytz}
BuildRequires: %{python_module requests >= 2.17.0}