Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/tests/arithmetic/test_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def test_sub_object(self):
index - "foo"

with pytest.raises(TypeError, match=msg):
index - np.array([2, "foo"])
index - np.array([2, "foo"], dtype=object)

def test_rsub_object(self):
# GH#19369
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/dtypes/test_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ def test_infer_dtype_datetime64_with_na(self, na_value):
np.array([np.datetime64("2011-01-01"), Timestamp("2011-01-02")]),
np.array([Timestamp("2011-01-02"), np.datetime64("2011-01-01")]),
np.array([np.nan, Timestamp("2011-01-02"), 1.1]),
np.array([np.nan, "2011-01-01", Timestamp("2011-01-02")]),
np.array([np.nan, "2011-01-01", Timestamp("2011-01-02")], dtype=object),
np.array([np.datetime64("nat"), np.timedelta64(1, "D")], dtype=object),
np.array([np.timedelta64(1, "D"), np.datetime64("nat")], dtype=object),
],
Expand Down
3 changes: 1 addition & 2 deletions pandas/tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,5 @@ def test_serializable(obj):
class TestIsBoolIndexer:
def test_non_bool_array_with_na(self):
# in particular, this should not raise
arr = np.array(["A", "B", np.nan])

arr = np.array(["A", "B", np.nan], dtype=object)
assert not com.is_bool_indexer(arr)
8 changes: 6 additions & 2 deletions pandas/tests/tools/test_to_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,10 @@ def test_to_datetime_infer_datetime_format_inconsistent_format(self, cache):
@pytest.mark.parametrize("cache", [True, False])
def test_to_datetime_infer_datetime_format_series_with_nans(self, cache):
s = Series(
np.array(["01/01/2011 00:00:00", np.nan, "01/03/2011 00:00:00", np.nan])
np.array(
["01/01/2011 00:00:00", np.nan, "01/03/2011 00:00:00", np.nan],
dtype=object,
)
)
tm.assert_series_equal(
to_datetime(s, infer_datetime_format=False, cache=cache),
Expand All @@ -1916,7 +1919,8 @@ def test_to_datetime_infer_datetime_format_series_start_with_nans(self, cache):
"01/01/2011 00:00:00",
"01/02/2011 00:00:00",
"01/03/2011 00:00:00",
]
],
dtype=object,
)
)

Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/util/test_hashing.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def test_hash_array(series):


@pytest.mark.parametrize(
"arr2", [np.array([3, 4, "All"]), np.array([3, 4, "All"], dtype=object)]
"arr2", [np.array([3, 4, "All"], dtype="U"), np.array([3, 4, "All"], dtype=object)]
)
def test_hash_array_mixed(arr2):
result1 = hash_array(np.array(["3", "4", "All"]))
Expand Down