False flags errors from `nbqa isort`
See original GitHub issueWhen running nbqa isort
on some notebooks which have already been fixed up previously with nbqa isort
, false flag errors are being raised. Take a look at the terminal output below. I have a notebook, examples/custom-nodes.ipynb
, which does not contain any isort formatting issues, as it was alrady run through nbqa isort
. Running nbqa isort
with --check-only
indicates an error. Running nbqa isort
again indicates that changes were made to the file. Running git diff
shows that no changes were infact made. Running nbqa isort
with --check-only
again still reports that there are errors in the file.
$ nbqa isort --check-only examples/custom-nodes.ipynb
ERROR: /made/up/path/to/examples/custom-nodes.ipynb Imports are incorrectly sorted and/or formatted.
$ nbqa isort examples/custom-nodes.ipynb
Fixing /made/up/path/to/examples/custom-nodes.ipynb
$ git diff examples/custom-nodes.ipynb
$ nbqa isort --check-only examples/custom-nodes.ipynb
ERROR: /made/up/path/to/examples/custom-nodes.ipynb Imports are incorrectly sorted and/or formatted.
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (1 by maintainers)
Top Results From Across the Web
Strange docs in "Known Limitations" · Issue #386 · nbQA-dev ...
Hi! I was reading your docs and then I found this: The text says "after trailing comma", but the examples are using trailing...
Read more >nbQA Documentation
Say you're running nbqa isort on a directory my_directory. ... Fixed bug whereby nbqa was giving the wrong error message when running nbqa...
Read more >Configuration options for isort
Shows extra quiet output, only errors are outputted. Type: Bool Default: False Config default: false. Python & Config File Name: quiet. CLI Flags:....
Read more >What is isort and why does it think that it is a incorrect import ...
Quick Fixing it does nothing, but the error disappears until VSCode restart or adding another import.
Read more >NbQA: Run Isort, Pyupgrade, Mypy,... on Jupyter Notebook
nbqa isort my_notebook.ipynb Fixing my_notebook.ipynb ... level heading -=== +# First level heading To apply these changes, remove the `--nbqa-diff` flag.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sure, tomorrow I’ll post some outputs as I step through the code
Another solution could be to change the return code of nbqa-diff to be 1 if the tool would have modified the notebook and 0 otherwise. Then you could use that in CI in place of isort’s check-only
Fixed in version 1.3.0 🚀