Closed baggiponte closed 10 months ago
\cc @dhruvmanila
This is happening because the cell containing the imports has a cell magic defined:
%%capture
import polars as pl
# ...
We ignore cell containing cell magics as they apply to the entire cell. The reasoning behind that is mentioned here: https://github.com/astral-sh/ruff/issues/7908#issuecomment-1756749556
Separately, I'm not sure if %%capture
is really useful in a cell containing imports as there probably won't be any output when running the cell.
I'll close this considering this as expected but feel free to ask any further questions or clarification required.
Ops totally right, sorry @dhruvmanila. Thank you for the prompt answers!
No problem, happy to help :)
A project I maintain,
functime
, uses ruff to lint the notebooks. I just ran ruff on this notebook and I get a slew of errors of imported objects (e.g.pl
) that are flagged as undefined variables:Our configs: