Closed
Description
Summary

harupy/mlflow@3f1650d: a commit that replicates what ruff does:
Without "id": null
, the notebook renders fine:
https://github.com/harupy/mlflow/blob/dab36dc4fd6ac6e442bb78c016e7813ced8c0a21/examples/h2o/random_forest.ipynb

How to reproduce
# Notebook without id
> cat a.ipynb
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import math\n",
"import os\n",
"\n",
"math.pi"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python (ruff)",
"language": "python",
"name": "ruff"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
# Run ruff
> cargo run -p ruff_cli -- check --fix --no-cache a.ipynb
Finished dev [unoptimized + debuginfo] target(s) in 0.07s
Running `target/debug/ruff check --fix --no-cache a.ipynb`
Found 1 error (1 fixed, 0 remaining).
# Check
> cat a.ipynb
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": null,
"metadata": {},
"outputs": [],
"source": [
"import math\n",
"\n",
"math.pi"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python (ruff)",
"language": "python",
"name": "ruff"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}