Skip to content

Commit 1660057

Browse files
committed
troubleshoot
1 parent b73507f commit 1660057

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

ci/deps/azure-36-minimum_versions.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: pandas-dev
22
channels:
3-
- defaults
43
- conda-forge
54
dependencies:
65
- python=3.6.1

pandas/tests/dtypes/cast/test_promote.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,13 @@ def _assert_match(result_fill_value, expected_fill_value):
9898
# GH#23982/25425 require the same type in addition to equality/NA-ness
9999
res_type = type(result_fill_value)
100100
ex_type = type(expected_fill_value)
101-
if res_type.__name__ == "uint64":
102-
# No idea why, but these (sometimes) do not compare as equal
103-
assert ex_type.__name__ == "uint64"
104-
elif res_type.__name__ == "ulonglong":
105-
# On some builds we get this instead of np.uint64
106-
# Note: cant check res_type.dtype.itemsize directly on numpy 1.18
107-
assert res_type(0).itemsize == 8
108-
assert ex_type == res_type or ex_type == np.uint64
101+
102+
if hasattr(result_fill_value, "dtype"):
103+
# Compare types in a way that is robust to platform-specific
104+
# idiosyncracies where e.g. sometimes we get "ulonglong" as an alias
105+
# for "uint64" or "intc" as an alias for "int32"
106+
assert result_fill_value.dtype.kind == expected_fill_value.dtype.kind
107+
assert result_fill_value.dtype.itemsize == expected_fill_value.dtype.itemsize
109108
else:
110109
# On some builds, type comparison fails, e.g. np.int32 != np.int32
111110
assert res_type == ex_type or res_type.__name__ == ex_type.__name__

0 commit comments

Comments
 (0)