Pandas version checks
-
[x] I have checked that this issue has not already been reported.
-
[x] I have confirmed this bug exists on the latest version of pandas.
-
[ ] I have confirmed this bug exists on the main branch of pandas.
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
Comment From: rhshadrach
Thanks for the report.
pandas release 2.2.3
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.
Comment From: chalmerlowe
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.