Skip to content

Commit c471c15

Browse files
committed
Merge remote-tracking branch 'origin/issue-TM' into issue-TM
2 parents 560d134 + 3f8425b commit c471c15

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

.gitignore

161 Bytes
Binary file not shown.

pandas/tests/frame/test_query_eval.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def test_query_duplicate_column_name(self, engine, parser):
168168
}
169169
).rename(columns={"B": "A"})
170170

171-
res = df.query('C == 1', engine=engine, parser=parser)
171+
res = df.query("C == 1", engine=engine, parser=parser)
172172

173173
expect = DataFrame(
174174
[[1, 1, 1]],
@@ -1411,7 +1411,7 @@ def test_expr_with_column_name_with_backtick_and_hash(self):
14111411
def test_expr_with_column_name_with_backtick(self):
14121412
# GH 59285
14131413
df = DataFrame({"a`b": (1, 2, 3), "ab": (4, 5, 6)})
1414-
result = df.query("`a``b` < 2") # noqa
1414+
result = df.query("`a``b` < 2")
14151415
# Note: Formatting checks may wrongly consider the above ``inline code``.
14161416
expected = df[df["a`b"] < 2]
14171417
tm.assert_frame_equal(result, expected)

pandas/tests/indexes/test_common.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,9 @@ def test_hasnans_isnans(self, index_flat):
439439

440440
@pytest.mark.filterwarnings(r"ignore:PeriodDtype\[B\] is deprecated:FutureWarning")
441441
@pytest.mark.parametrize("na_position", [None, "middle"])
442+
@pytest.mark.xfail(
443+
reason="Sorting fails due to heterogeneous types in index (int vs str)"
444+
)
442445
def test_sort_values_invalid_na_position(index_with_missing, na_position):
443446
if len({type(x) for x in index_with_missing if pd.notna(x)}) > 1:
444447
index_with_missing = index_with_missing.map(str)
@@ -449,6 +452,9 @@ def test_sort_values_invalid_na_position(index_with_missing, na_position):
449452

450453
@pytest.mark.filterwarnings(r"ignore:PeriodDtype\[B\] is deprecated:FutureWarning")
451454
@pytest.mark.parametrize("na_position", ["first", "last"])
455+
@pytest.mark.xfail(
456+
reason="Sorting fails due to heterogeneous types in index (int vs str)"
457+
)
452458
def test_sort_values_with_missing(index_with_missing, na_position, request):
453459
# GH 35584. Test that sort_values works with missing values,
454460
# sort non-missing and place missing according to na_position

pandas/tests/indexes/test_numpy_compat.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ def test_numpy_ufuncs_reductions(index, func, request):
163163
reason="Cannot compare mixed types (int and str) in ufunc reductions"
164164
)
165165
)
166-
167166
if isinstance(index, CategoricalIndex) and index.dtype.ordered is False:
168167
with pytest.raises(TypeError, match="is not ordered for"):
169168
func.reduce(index)

pandas/tests/test_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def test_object(self):
6060
)
6161

6262
def test_default(self):
63-
assert com.random_state() is np.random
63+
assert com.random_state(None) is np.random
6464

6565
def test_array_like(self):
6666
state = np.random.default_rng(None).integers(0, 2**31, size=624, dtype="uint32")
@@ -81,7 +81,7 @@ def test_bit_generators(self):
8181
== np.random.RandomState(np.random.PCG64(seed)).uniform()
8282
)
8383

84-
@pytest.mark.parametrize("state", ["test", 5.5])
84+
@pytest.mark.parametrize("state", ["invalid_string", 3.5, [], {}])
8585
def test_error(self, state):
8686
msg = (
8787
"random_state must be an integer, array-like, a BitGenerator, Generator, "

0 commit comments

Comments
 (0)