@@ -54,6 +54,11 @@ def make_rand_df(size: int, **kwargs):
54
54
r = [f"ssssss{ x } " for x in range (10 )]
55
55
c = np .random .randint (10 , size = size )
56
56
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" )
57
62
elif dt is datetime :
58
63
rt = [datetime (2020 , 1 , 1 ) + timedelta (days = x ) for x in range (10 )]
59
64
c = np .random .randint (10 , size = size )
@@ -337,7 +342,13 @@ def test_agg_sum_avg():
337
342
338
343
def test_agg_min_max_no_group_by ():
339
344
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 ),
341
352
)
342
353
eq_sqlite (
343
354
"""
@@ -352,6 +363,8 @@ def test_agg_min_max_no_group_by():
352
363
MAX(d) AS max_d,
353
364
MIN(e) AS min_e,
354
365
MAX(e) AS max_e,
366
+ MIN(f) as min_f,
367
+ MAX(f) as max_f,
355
368
MIN(a+e) AS mix_1,
356
369
MIN(a)+MIN(e) AS mix_2
357
370
FROM a
@@ -362,7 +375,13 @@ def test_agg_min_max_no_group_by():
362
375
363
376
def test_agg_min_max ():
364
377
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 ),
366
385
)
367
386
eq_sqlite (
368
387
"""
@@ -374,6 +393,8 @@ def test_agg_min_max():
374
393
MAX(d) AS max_d,
375
394
MIN(e) AS min_e,
376
395
MAX(e) AS max_e,
396
+ MIN(f) AS min_f,
397
+ MAX(f) AS max_f,
377
398
MIN(a+e) AS mix_1,
378
399
MIN(a)+MIN(e) AS mix_2
379
400
FROM a GROUP BY a, b
0 commit comments