Skip to content

Commit d472646

Browse files
committed
try removing restriction on windows
1 parent 8d07cae commit d472646

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

pandas/tests/indexing/test_coercion.py

-7
Original file line numberDiff line numberDiff line change
@@ -1183,13 +1183,6 @@ def _assert_replace_conversion(self, from_key, to_key, how):
11831183

11841184
result = obj.replace(replacer)
11851185

1186-
# buggy on windows for bool/int64
1187-
if (from_key == 'bool' and
1188-
to_key == 'int64' and
1189-
tm.is_platform_windows()):
1190-
pytest.skip("windows platform buggy: {0} -> {1}".format
1191-
(from_key, to_key))
1192-
11931186
if ((from_key == 'float64' and to_key in ('int64')) or
11941187
(from_key == 'complex128' and
11951188
to_key in ('int64', 'float64'))):

pandas/types/cast.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -928,13 +928,14 @@ def _find_common_type(types):
928928
if all(is_timedelta64_dtype(t) for t in types):
929929
return np.dtype('timedelta64[ns]')
930930

931-
# don't mix bool / int or float
932-
# this is different from numpy, which casts bool/int as int
931+
# don't mix bool / int or float or complex
932+
# this is different from numpy, which casts bool with float/int as int
933933
has_bools = any(is_bool_dtype(t) for t in types)
934-
has_ints = any(is_integer_dtype(t) for t in types)
935-
has_floats = any(is_float_dtype(t) for t in types)
936-
has_complex = any(is_complex_dtype(t) for t in types)
937-
if has_bools and (has_ints or has_floats or has_complex):
938-
return np.object
934+
if has_bools:
935+
has_ints = any(is_integer_dtype(t) for t in types)
936+
has_floats = any(is_float_dtype(t) for t in types)
937+
has_complex = any(is_complex_dtype(t) for t in types)
938+
if has_ints or has_floats or has_complex:
939+
return np.object
939940

940941
return np.find_common_type(types, [])

0 commit comments

Comments
 (0)