Skip to content

Commit db7ba4d

Browse files
committed
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.
1 parent ddd36e8 commit db7ba4d

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

docs/by-example/sqlalchemy/dataframe.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ The package provides a ``bulk_insert`` function to use the
7676
workload across multiple batches, using a defined chunk size.
7777

7878
>>> import sqlalchemy as sa
79-
>>> from pandas._testing import makeTimeDataFrame
8079
>>> from crate.client.sqlalchemy.support import insert_bulk
80+
>>> from pueblo.testing.pandas import makeTimeDataFrame
8181
...
8282
>>> # Define number of records, and chunk size.
8383
>>> INSERT_RECORDS = 42
@@ -159,8 +159,8 @@ in a batched/chunked manner, using a defined chunk size, effectively using the
159159
pandas implementation introduced in the previous section.
160160

161161
>>> import dask.dataframe as dd
162-
>>> from pandas._testing import makeTimeDataFrame
163162
>>> from crate.client.sqlalchemy.support import insert_bulk
163+
>>> from pueblo.testing.pandas import makeTimeDataFrame
164164
...
165165
>>> # Define the number of records, the number of computing partitions,
166166
>>> # and the chunk size of each database insert operation.

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def read(path):
7676
'stopit>=1.1.2,<2',
7777
'flake8>=4,<8',
7878
'pandas<2.3',
79+
'pueblo>=0.0.7',
7980
'pytz',
8081
],
8182
doc=['sphinx>=3.5,<8',

src/crate/client/sqlalchemy/tests/bulk_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ def test_bulk_save_pandas(self, mock_cursor):
176176
"""
177177
Verify bulk INSERT with pandas.
178178
"""
179-
from pandas._testing import makeTimeDataFrame
180179
from crate.client.sqlalchemy.support import insert_bulk
180+
from pueblo.testing.pandas import makeTimeDataFrame
181181

182182
# 42 records / 8 chunksize = 5.25, which means 6 batches will be emitted.
183183
INSERT_RECORDS = 42
@@ -216,8 +216,8 @@ def test_bulk_save_dask(self, mock_cursor):
216216
Verify bulk INSERT with Dask.
217217
"""
218218
import dask.dataframe as dd
219-
from pandas._testing import makeTimeDataFrame
220219
from crate.client.sqlalchemy.support import insert_bulk
220+
from pueblo.testing.pandas import makeTimeDataFrame
221221

222222
# 42 records / 4 partitions means each partition has a size of 10.5 elements.
223223
# Because the chunk size 8 is slightly smaller than 10, the partition will not

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy