-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Closed
Copy link
Labels
Error ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandasTestingpandas testing functions or related to the test suitepandas testing functions or related to the test suitegood first issue
Description
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
Reproducible Example
N/A
Issue Description
When I run compliance tests in python-db-dtype-pandas (a support file used by python-bigquery) I am getting multiple warnings (which cause test failures) due to a recent update in how pytest handles regex matches.
In pandas release 2.2.3 there is a snippet of code:
def test_take_pandas_style_negative_raises(self, data, na_value):
with pytest.raises(ValueError, match=""):
Pytest returns this Warning:
pytest.PytestWarning: matching against an empty string will *always* pass. If you want to check for an empty message you need to pass '^$'. If you don't want to match you should pass `None` or leave out the parameter.
This warning shows up in association with each of these pandas tests (it may occur with other tests, but these are the only ones that my tests revealed.):
FAILED ...::TestGetitem::test_take_pandas_style_negative_raises
FAILED ...::TestMethods::test_argmax_argmin_no_skipna_notimplemented
FAILED ...::TestSetitem::test_setitem_invalid
FAILED ...::TestJSONArrayGetitem::test_take_pandas_style_negative_raises
FAILED ...::TestJSONArrayMethods::test_argmax_argmin_no_skipna_notimplemented
FAILED ...::TestJSONArraySetitem::test_setitem_invalid
Expected Behavior
N/A
Installed Versions
N/A
Metadata
Metadata
Assignees
Labels
Error ReportingIncorrect or improved errors from pandasIncorrect or improved errors from pandasTestingpandas testing functions or related to the test suitepandas testing functions or related to the test suitegood first issue
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
rhshadrach commentedon Jun 5, 2025
Thanks for the report.
To be sure, we'd only fix these on main. So it's not too important for us if this is in the 2.2.3 release. Does that cause you any issues?
For
test_take_pandas_style_negative_raises
, this is now fixed on main, but at least some of the others you listed are not. PR to update these are welcome.chalmerlowe commentedon Jun 6, 2025
I am not worried about having any of these backported to released versions of pandas. Getting them into
main
and queued up for inclusion in the next release should be sufficient.Will take a look at the PR issued by @iabhi4 for completeness and correctness.