nbQA-dev / nbQA

Run ruff, isort, pyupgrade, mypy, pylint, flake8, and more on Jupyter Notebooks
https://nbqa.readthedocs.io/en/latest/index.html
MIT License
1.04k stars 41 forks source link

implicitly imported members (e.g. display) reported as missing #785

Closed marscher closed 1 year ago

marscher commented 1 year ago

For instance a cell containing:

display(obj)

will report: F821 Undefined name display

for tools like Ruff and Flake8.

I wonder how I can workaround this or if we even need to consider to transform the code to include implicit imports by the notebook?

MarcoGorelli commented 1 year ago

hi @marscher , thanks for your report

you can import it explicitly:

from IPython.display  import display
marscher commented 1 year ago

Indeed. That was too simple. Sorry for wasting your time.