We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 375aaa4 commit bc9bba4Copy full SHA for bc9bba4
pandas/tests/groupby/test_grouping.py
@@ -408,8 +408,14 @@ def test_groupby_grouper_f_sanity_checked(self):
408
# when the elements are Timestamp.
409
# the result is Index[0:6], very confusing.
410
411
- msg = r"Grouper result violates len\(labels\) == len\(data\)"
412
- with pytest.raises(AssertionError, match=msg):
+ # GH36158
+ # 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):
419
ts.groupby(lambda key: key[0:6])
420
421
def test_grouping_error_on_multidim_input(self, df):
0 commit comments