Skip to content

Commit f255870

Browse files
dimithrasrhshadrach
andcommitted
Failing test edited
Previous assertion replaced with a new check. Added description to linking issue. Co-Authored-By: Richard Shadrach <[email protected]>
1 parent 59d6624 commit f255870

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pandas/tests/groupby/test_grouping.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,14 @@ def test_groupby_grouper_f_sanity_checked(self):
408408
# when the elements are Timestamp.
409409
# the result is Index[0:6], very confusing.
410410

411-
msg = r"Grouper result violates len\(labels\) == len\(data\)"
412-
with pytest.raises(AssertionError, match=msg):
411+
# GH36158
412+
# issue references errors for groupby
413+
# created with functions (lambda or named)
414+
# after changes applied under that issue this test fails with a
415+
# more sensible error than the previous assertion.
416+
417+
msg = r"'Timestamp' object is not subscriptable"
418+
with pytest.raises(TypeError, match=msg):
413419
ts.groupby(lambda key: key[0:6])
414420

415421
def test_grouping_error_on_multidim_input(self, df):

0 commit comments

Comments
 (0)