Skip to content

Commit 1fdb49d

Browse files
Backport PR #33566: CI: Fix jedi deprecation warning for 0.17.0 on IPython (#33972)
Co-authored-by: Kaiqi Dong <[email protected]>
1 parent 2d0acbd commit 1fdb49d

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

pandas/tests/frame/test_api.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,18 @@ async def test_tab_complete_warning(self, ip):
548548

549549
code = "import pandas as pd; df = pd.DataFrame()"
550550
await ip.run_code(code)
551-
with tm.assert_produces_warning(None):
551+
552+
# TODO: remove it when Ipython updates
553+
# GH 33567, jedi version raises Deprecation warning in Ipython
554+
import jedi
555+
556+
if jedi.__version__ < "0.17.0":
557+
warning = tm.assert_produces_warning(None)
558+
else:
559+
warning = tm.assert_produces_warning(
560+
DeprecationWarning, check_stacklevel=False
561+
)
562+
with warning:
552563
with provisionalcompleter("ignore"):
553564
list(ip.Completer.completions("df.", 1))
554565

pandas/tests/resample/test_resampler_grouper.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,15 @@ async def test_tab_complete_ipython6_warning(ip):
2828
)
2929
await ip.run_code(code)
3030

31-
with tm.assert_produces_warning(None):
31+
# TODO: remove it when Ipython updates
32+
# GH 33567, jedi version raises Deprecation warning in Ipython
33+
import jedi
34+
35+
if jedi.__version__ < "0.17.0":
36+
warning = tm.assert_produces_warning(None)
37+
else:
38+
warning = tm.assert_produces_warning(DeprecationWarning, check_stacklevel=False)
39+
with warning:
3240
with provisionalcompleter("ignore"):
3341
list(ip.Completer.completions("rs.", 1))
3442

pandas/tests/series/test_api.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,18 @@ async def test_tab_complete_warning(self, ip):
501501

502502
code = "import pandas as pd; s = pd.Series()"
503503
await ip.run_code(code)
504-
with tm.assert_produces_warning(None):
504+
505+
# TODO: remove it when Ipython updates
506+
# GH 33567, jedi version raises Deprecation warning in Ipython
507+
import jedi
508+
509+
if jedi.__version__ < "0.17.0":
510+
warning = tm.assert_produces_warning(None)
511+
else:
512+
warning = tm.assert_produces_warning(
513+
DeprecationWarning, check_stacklevel=False
514+
)
515+
with warning:
505516
with provisionalcompleter("ignore"):
506517
list(ip.Completer.completions("s.", 1))
507518

0 commit comments

Comments
 (0)