File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -123,12 +123,16 @@ def concat_arrays(to_concat: list) -> ArrayLike:
123
123
# ignore the all-NA proxies to determine the resulting dtype
124
124
to_concat_no_proxy = [x for x in to_concat if not isinstance (x , NullArrayProxy )]
125
125
126
- single_dtype = len ({x .dtype for x in to_concat_no_proxy }) == 1
126
+ dtypes = {x .dtype for x in to_concat_no_proxy }
127
+ single_dtype = len (dtypes ) == 1
127
128
128
- if not single_dtype :
129
- target_dtype = find_common_type ([arr .dtype for arr in to_concat_no_proxy ])
130
- else :
129
+ if single_dtype :
131
130
target_dtype = to_concat_no_proxy [0 ].dtype
131
+ elif all (x .kind in ["i" , "u" , "b" ] and isinstance (x , np .dtype ) for x in dtypes ):
132
+ # GH#42092
133
+ target_dtype = np .find_common_type (list (dtypes ), [])
134
+ else :
135
+ target_dtype = find_common_type ([arr .dtype for arr in to_concat_no_proxy ])
132
136
133
137
if target_dtype .kind in ["m" , "M" ]:
134
138
# for datetimelike use DatetimeArray/TimedeltaArray concatenation
You can’t perform that action at this time.
0 commit comments