Skip to content

Conversation

@markmcd
Copy link
Contributor

@markmcd markmcd commented Sep 14, 2022

nbformat currently barfs on this notebook as it has an id field set directly on the cell. They're expected under a metadata field, and this notebook already has them set on the metadata, so assuming they're otherwise unused I have removed them.

Here's the error, in case it helps:

E 2022-09-08 20:30:15.962852-070026 57758 __init__.py:80 Notebook JSON is invalid: Additional properties are not allowed ('id' was unexpected)

Failed validating 'additionalProperties' in code_cell:

On instance['cells'][0]:
{'cell_type': 'code',
 'execution_count': 1,
 'id': 'ee22a795',
 'metadata': {'cellView': 'form',
              'execution': {'iopub.execute_input': '2022-07-07T09:27:05.420016Z',
                            'iopub.status.busy': '2022-07-07T09:27:05.419434Z',
                            'iopub.status.idle': '2022-07-07T09:27:05.423857Z',
                            'shell.execute_reply': '2022-07-07T09:27:05.423255Z'},
              'id': '906e07f6e562'},
 'outputs': ['...0 outputs...'],
 'source': '# @title Copyright 2022 The Cirq Developers\n'
           '# Licensed under the...'}

`nbformat` currently barfs on this notebook as it has an `id` field set directly on the cell. They're expected under a `metadata` field, and this notebook already has them set on the metadata, so assuming they're otherwise unused I have removed them.

Here's the error, in case it helps:

```
E 2022-09-08 20:30:15.962852-070026 57758 __init__.py:80 Notebook JSON is invalid: Additional properties are not allowed ('id' was unexpected)

Failed validating 'additionalProperties' in code_cell:

On instance['cells'][0]:
{'cell_type': 'code',
 'execution_count': 1,
 'id': 'ee22a795',
 'metadata': {'cellView': 'form',
              'execution': {'iopub.execute_input': '2022-07-07T09:27:05.420016Z',
                            'iopub.status.busy': '2022-07-07T09:27:05.419434Z',
                            'iopub.status.idle': '2022-07-07T09:27:05.423857Z',
                            'shell.execute_reply': '2022-07-07T09:27:05.423255Z'},
              'id': '906e07f6e562'},
 'outputs': ['...0 outputs...'],
 'source': '# @title Copyright 2022 The Cirq Developers\n'
           '# Licensed under the...'}
```
@markmcd markmcd requested review from a team, cduck and vtomole as code owners September 14, 2022 05:17
@CirqBot CirqBot added the size: S 10< lines changed <50 label Sep 14, 2022
@markmcd markmcd requested a review from viathor September 14, 2022 05:17
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@markmcd
Copy link
Contributor Author

markmcd commented Sep 14, 2022

Failed Pytest looks like differences in floating point rounding, I'm guessing unrelated to this change?

@vtomole
Copy link
Collaborator

vtomole commented Oct 14, 2022

@markmcd What did you run to get this error? This passes on the master branch for me.

(cirq_venv) vtomole@vtomole:~/Cirq$ ./check/nbformat 
Notebooks are formatted.

Copy link
Collaborator

@vtomole vtomole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vtomole vtomole merged commit 7974c9a into quantumlib:master Oct 17, 2022
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
`nbformat` currently barfs on this notebook as it has an `id` field set directly on the cell. They're expected under a `metadata` field, and this notebook already has them set on the metadata, so assuming they're otherwise unused I have removed them.

Here's the error, in case it helps:

```
E 2022-09-08 20:30:15.962852-070026 57758 __init__.py:80 Notebook JSON is invalid: Additional properties are not allowed ('id' was unexpected)

Failed validating 'additionalProperties' in code_cell:

On instance['cells'][0]:
{'cell_type': 'code',
 'execution_count': 1,
 'id': 'ee22a795',
 'metadata': {'cellView': 'form',
              'execution': {'iopub.execute_input': '2022-07-07T09:27:05.420016Z',
                            'iopub.status.busy': '2022-07-07T09:27:05.419434Z',
                            'iopub.status.idle': '2022-07-07T09:27:05.423857Z',
                            'shell.execute_reply': '2022-07-07T09:27:05.423255Z'},
              'id': '906e07f6e562'},
 'outputs': ['...0 outputs...'],
 'source': '# @title Copyright 2022 The Cirq Developers\n'
           '# Licensed under the...'}
```

Co-authored-by: Victory Omole <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: S 10< lines changed <50

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants