Skip to content

Commit 1e2d87b

Browse files
authored
CI/DEPS: Correct xfail condition for new pymysql (#52260)
1 parent 2e0c8a4 commit 1e2d87b

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 (
@@ -2397,9 +2398,12 @@ def test_to_sql_with_negative_npinf(self, input, request):
23972398
# The input {"foo": [-np.inf], "infe0": ["bar"]} does not raise any error
23982399
# for pymysql version >= 0.10
23992400
# TODO(GH#36465): remove this version check after GH 36465 is fixed
2400-
import pymysql
2401+
pymysql = pytest.importorskip("pymysql")
24012402

2402-
if pymysql.VERSION[0:3] >= (0, 10, 0) and "infe0" in df.columns:
2403+
if (
2404+
Version(pymysql.__version__) < Version("1.0.3")
2405+
and "infe0" in df.columns
2406+
):
24032407
mark = pytest.mark.xfail(reason="GH 36465")
24042408
request.node.add_marker(mark)
24052409

0 commit comments

Comments
 (0)