Skip to content

Commit f74e0d2

Browse files
Backport PR pandas-dev#52260 on branch 2.0.x (CI/DEPS: Correct xfail condition for new pymysql) (pandas-dev#52265)
Backport PR pandas-dev#52260: CI/DEPS: Correct xfail condition for new pymysql Co-authored-by: Matthew Roeschke <[email protected]>
1 parent 9fc32de commit f74e0d2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pandas/tests/io/test_sql.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
ArrowStringArray,
6060
StringArray,
6161
)
62+
from pandas.util.version import Version
6263

6364
from pandas.io import sql
6465
from pandas.io.sql import (
@@ -2393,9 +2394,12 @@ def test_to_sql_with_negative_npinf(self, input, request):
23932394
# The input {"foo": [-np.inf], "infe0": ["bar"]} does not raise any error
23942395
# for pymysql version >= 0.10
23952396
# TODO(GH#36465): remove this version check after GH 36465 is fixed
2396-
import pymysql
2397+
pymysql = pytest.importorskip("pymysql")
23972398

2398-
if pymysql.VERSION[0:3] >= (0, 10, 0) and "infe0" in df.columns:
2399+
if (
2400+
Version(pymysql.__version__) < Version("1.0.3")
2401+
and "infe0" in df.columns
2402+
):
23992403
mark = pytest.mark.xfail(reason="GH 36465")
24002404
request.node.add_marker(mark)
24012405

0 commit comments

Comments
 (0)