From 931d7ce2ff9a4c14c951d737bc13142c40b9d2f5 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Tue, 30 Jan 2024 21:25:29 +0100 Subject: [PATCH] Testing: Pull `makeTimeDataFrame` and `makeMixedDataFrame` from pueblo `pandas._testing.{makeTimeDataFrame,makeMixedDataFrame}` were removed on behalf of pandas 2.2.0. This patch pulls corresponding polyfills from a hostel package. --- influxio/core.py | 3 ++- influxio/testdata.py | 2 +- pyproject.toml | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/influxio/core.py b/influxio/core.py index d317325..f277992 100644 --- a/influxio/core.py +++ b/influxio/core.py @@ -4,7 +4,6 @@ from yarl import URL from influxio.model import InfluxDbAdapter, SqlAlchemyAdapter -from influxio.testdata import DataFrameFactory from influxio.util.db import get_sqlalchemy_dialects logger = logging.getLogger(__name__) @@ -51,6 +50,8 @@ def copy(source: str, target: str, progress: bool = False): raise NotImplementedError(f"Data sink not implemented: {target_url}") if source_url.scheme == "testdata": + from influxio.testdata import DataFrameFactory + dff = DataFrameFactory(**source_url.query) df = dff.make(source_url.host) sink.write_df(df) diff --git a/influxio/testdata.py b/influxio/testdata.py index ece9f53..bce9e60 100644 --- a/influxio/testdata.py +++ b/influxio/testdata.py @@ -6,8 +6,8 @@ import numpy as np import pandas as pd -from pandas._testing import makeMixedDataFrame, makeTimeDataFrame from pandas.io.formats.info import DataFrameInfo +from pueblo.testing.pandas import makeMixedDataFrame, makeTimeDataFrame logger = logging.getLogger(__name__) diff --git a/pyproject.toml b/pyproject.toml index 9edd1fe..3a36aa6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -86,6 +86,7 @@ dependencies = [ "line-protocol-parser<2", "pandas<2.3", "psycopg2-binary<3", + "pueblo>=0.0.7", "SQLAlchemy-Utils<0.42", "yarl<2", ]