Skip to content

CI: Fix Deprecation warning from jedi #33563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
13 changes: 12 additions & 1 deletion pandas/tests/frame/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,18 @@ async def test_tab_complete_warning(self, ip):

code = "import pandas as pd; df = pd.DataFrame()"
await ip.run_code(code)
with tm.assert_produces_warning(None):

# TODO: remove it when Ipython updates
# jedi version raises Deprecation warning in Ipython
import jedi

if jedi.__version__ < "0.16.0":
warning = tm.assert_produces_warning(None)
else:
warning = tm.assert_produces_warning(
DeprecationWarning, check_stacklevel=False
)
with tm.assert_produces_warning(warning):
with provisionalcompleter("ignore"):
list(ip.Completer.completions("df.", 1))

Expand Down
12 changes: 11 additions & 1 deletion pandas/tests/resample/test_resampler_grouper.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,17 @@ async def test_tab_complete_ipython6_warning(ip):
)
await ip.run_code(code)

with tm.assert_produces_warning(None):
# TODO: remove it when Ipython updates
# jedi version raises Deprecation warning in Ipython
import jedi

if jedi.__version__ < "0.16.0":
warning = tm.assert_produces_warning(None)
else:
warning = tm.assert_produces_warning(
DeprecationWarning, check_stacklevel=False
)
with tm.assert_produces_warning(warning):
with provisionalcompleter("ignore"):
list(ip.Completer.completions("rs.", 1))

Expand Down
13 changes: 12 additions & 1 deletion pandas/tests/series/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,18 @@ async def test_tab_complete_warning(self, ip):

code = "import pandas as pd; s = pd.Series()"
await ip.run_code(code)
with tm.assert_produces_warning(None):

# TODO: remove it when Ipython updates
# jedi version raises Deprecation warning in Ipython
import jedi

if jedi.__version__ < "0.16.0":
warning = tm.assert_produces_warning(None)
else:
warning = tm.assert_produces_warning(
DeprecationWarning, check_stacklevel=False
)
with tm.assert_produces_warning(warning):
with provisionalcompleter("ignore"):
list(ip.Completer.completions("s.", 1))

Expand Down