Skip to content

Commit 6b83628

Browse files
meeseeksmachinecharlesdong1991
authored andcommitted
Backport PR #31323: CI: Fix jedi upgrades causes deprecation warning (#31341)
Co-authored-by: Kaiqi Dong <[email protected]>
1 parent 0685ce0 commit 6b83628

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

pandas/tests/arrays/categorical/test_warnings.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ async def test_tab_complete_warning(self, ip):
1414

1515
code = "import pandas as pd; c = Categorical([])"
1616
await ip.run_code(code)
17-
with tm.assert_produces_warning(None):
17+
18+
# GH 31324 newer jedi version raises Deprecation warning
19+
import jedi
20+
21+
if jedi.__version__ < "0.16.0":
22+
warning = tm.assert_produces_warning(None)
23+
else:
24+
warning = tm.assert_produces_warning(
25+
DeprecationWarning, check_stacklevel=False
26+
)
27+
with warning:
1828
with provisionalcompleter("ignore"):
1929
list(ip.Completer.completions("c.", 1))

pandas/tests/indexes/test_base.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -2408,7 +2408,17 @@ async def test_tab_complete_warning(self, ip):
24082408

24092409
code = "import pandas as pd; idx = pd.Index([1, 2])"
24102410
await ip.run_code(code)
2411-
with tm.assert_produces_warning(None):
2411+
2412+
# GH 31324 newer jedi version raises Deprecation warning
2413+
import jedi
2414+
2415+
if jedi.__version__ < "0.16.0":
2416+
warning = tm.assert_produces_warning(None)
2417+
else:
2418+
warning = tm.assert_produces_warning(
2419+
DeprecationWarning, check_stacklevel=False
2420+
)
2421+
with warning:
24122422
with provisionalcompleter("ignore"):
24132423
list(ip.Completer.completions("idx.", 4))
24142424

0 commit comments

Comments
 (0)