Skip to content
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

MissingIDFieldWarning Warning #677

Closed
bdsomer opened this issue Jul 27, 2023 · 6 comments
Closed

MissingIDFieldWarning Warning #677

bdsomer opened this issue Jul 27, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@bdsomer
Copy link
Contributor

bdsomer commented Jul 27, 2023

Describe the bug
When using otter assign on a notebook whose code cells have the id field, I get the following warning:

.../otter/assign/notebook_transformer.py:386: MissingIDFieldWarning: Code cell is missing an id field, this will become a hard error in future nbformat versions. You may want to use `normalize()` on your notebooks before validations (available since nbformat 5.1.4). Previous versions of nbformat are fixing this issue transparently, and will stop doing so in the future.
  _, nb = normalize(nb)

To Reproduce
Steps to reproduce the behavior: Use otter assign on a notebook whose code cells have the id field.

Expected behavior
There is no warning when using otter assign on properly formatted notebooks that have the id field.

Versions
Python 3.11.3, Otter 5.0.1

Additional context
It seems that this is caused by

remove_cell_ids(transformed_nb)
which was added to fix #340 (as the comment describes).

Also I am not sure if this issue is covered by #301; if that is the case, feel free to close this issue.

@bdsomer bdsomer added the bug Something isn't working label Jul 27, 2023
@chrispyles
Copy link
Member

What version of nbformat do you have installed? Also can you send a notebook that reproduces this? I thought this was fixed by this, which was added in v5.0.0 (cf. #658), but apparently not.

@taylorgibson
Copy link

I'm seeing a similar issue:

/home/gibson/mambaforge/envs/dstraining/lib/python3.11/site-packages/otter/assign/notebook_transformer.py:385: MissingIDFieldWarning: Code cell is missing an id field, this will become a hard error in future nbformat versions. You may want to use `normalize()` on your notebooks before validations (available since nbformat 5.1.4). Previous versions of nbformat are fixing this issue transparently, and will stop doing so in the future.
  _, nb = normalize(nb)
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.

Attaching a notebook file that produces this output.
demo.zip

Python version: 3.11.4
Otter-Grader version: 5.0.2

@chrispyles
Copy link
Member

@taylorgibson what version of nbformat do you have installed?

@taylorgibson
Copy link

nbformat is version 5.9.1

@taylorgibson
Copy link

Here's the full list of packages in the environment in case that's helpful:
myenv.txt

@chrispyles
Copy link
Member

This should be fixed in v5.1.0, where I've removed the patch that strips the cell IDs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants