File tree 2 files changed +10
-7
lines changed
2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -273,11 +273,9 @@ def _register_numpy_numbers(
273
273
274
274
builtin_type = getattr (builtins , builtin_name , None ) # uint doesn't exist
275
275
276
- # default to int64 regardless of OS
277
- default_pd_dtype = {
278
- "int" : np .dtype ("int64" ),
279
- "uint" : np .dtype ("uint64" ),
280
- }.get (builtin_name , pd .Series ([1 ], dtype = builtin_name ).dtype )
276
+ # use OS-specific type for integers. This will be int32 for Windows, int64
277
+ # for other systems.
278
+ default_int_dtype = pd .Series ([1 ], dtype = builtin_name ).dtype
281
279
282
280
for bit_width in sizes :
283
281
# e.g.: numpy.int64
@@ -292,10 +290,10 @@ def _register_numpy_numbers(
292
290
)
293
291
)
294
292
295
- if np_dtype == default_pd_dtype :
293
+ if np_dtype == default_int_dtype :
296
294
equivalents |= set (
297
295
(
298
- default_pd_dtype ,
296
+ default_int_dtype ,
299
297
builtin_name ,
300
298
getattr (dtypes , pandera_name ),
301
299
getattr (dtypes , pandera_name )(),
Original file line number Diff line number Diff line change 5
5
import dataclasses
6
6
import datetime
7
7
import inspect
8
+ import platform
8
9
import re
9
10
import sys
10
11
from decimal import Decimal
@@ -507,6 +508,10 @@ def test_default_numeric_dtypes():
507
508
== pandas_engine .Engine .dtype (int )
508
509
== pandas_engine .Engine .dtype ("int" )
509
510
)
511
+ if platform .system () == "Windows" :
512
+ assert default_int_dtype == np .dtype ("int32" )
513
+ else :
514
+ assert default_int_dtype == np .dtype ("int64" )
510
515
511
516
default_float_dtype = pd .Series ([1.0 ]).dtype
512
517
assert (
You can’t perform that action at this time.
0 commit comments