Skip to content

Commit

Permalink
Testing: Pull makeTimeDataFrame and makeMixedDataFrame from pueblo
Browse files Browse the repository at this point in the history
`pandas._testing.{makeTimeDataFrame,makeMixedDataFrame}` were removed on
behalf of pandas 2.2.0. This patch pulls corresponding polyfills from
a hostel package.
  • Loading branch information
amotl committed Jan 30, 2024
1 parent 5d5ede3 commit 931d7ce
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion influxio/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion influxio/testdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down

0 comments on commit 931d7ce

Please sign in to comment.