Skip to content

Commit ea48c7a

Browse files
committed
added StringDtype to test_compatibility.py
1 parent 89822d9 commit ea48c7a

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

tests/integration/test_compatibility.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ def make_rand_df(size: int, **kwargs):
5454
r = [f"ssssss{x}" for x in range(10)]
5555
c = np.random.randint(10, size=size)
5656
s = np.array([r[x] for x in c])
57+
elif dt is pd.StringDtype:
58+
r = [f"ssssss{x}" for x in range(10)]
59+
c = np.random.randint(10, size=size)
60+
s = np.array([r[x] for x in c])
61+
s = pd.array(s, dtype="string")
5762
elif dt is datetime:
5863
rt = [datetime(2020, 1, 1) + timedelta(days=x) for x in range(10)]
5964
c = np.random.randint(10, size=size)
@@ -337,7 +342,13 @@ def test_agg_sum_avg():
337342

338343
def test_agg_min_max_no_group_by():
339344
a = make_rand_df(
340-
100, a=(int, 50), b=(str, 50), c=(int, 30), d=(str, 40), e=(float, 40)
345+
100,
346+
a=(int, 50),
347+
b=(str, 50),
348+
c=(int, 30),
349+
d=(str, 40),
350+
e=(float, 40),
351+
f=(pd.StringDtype, 40),
341352
)
342353
eq_sqlite(
343354
"""
@@ -352,6 +363,8 @@ def test_agg_min_max_no_group_by():
352363
MAX(d) AS max_d,
353364
MIN(e) AS min_e,
354365
MAX(e) AS max_e,
366+
MIN(f) as min_f,
367+
MAX(f) as max_f,
355368
MIN(a+e) AS mix_1,
356369
MIN(a)+MIN(e) AS mix_2
357370
FROM a
@@ -362,7 +375,13 @@ def test_agg_min_max_no_group_by():
362375

363376
def test_agg_min_max():
364377
a = make_rand_df(
365-
100, a=(int, 50), b=(str, 50), c=(int, 30), d=(str, 40), e=(float, 40)
378+
100,
379+
a=(int, 50),
380+
b=(str, 50),
381+
c=(int, 30),
382+
d=(str, 40),
383+
e=(float, 40),
384+
f=(pd.StringDtype, 40),
366385
)
367386
eq_sqlite(
368387
"""
@@ -374,6 +393,8 @@ def test_agg_min_max():
374393
MAX(d) AS max_d,
375394
MIN(e) AS min_e,
376395
MAX(e) AS max_e,
396+
MIN(f) AS min_f,
397+
MAX(f) AS max_f,
377398
MIN(a+e) AS mix_1,
378399
MIN(a)+MIN(e) AS mix_2
379400
FROM a GROUP BY a, b

0 commit comments

Comments
 (0)