mark_ott
Databricks Employee
Databricks Employee

Databricks does not currently allow you to default to "execution_count": null (or "none") when stripping notebook outputs during a commit. The platform sets "execution_count": 0 as the default when outputs are stripped through their Git integration, and there is no exposed configuration, setting, or admin toggle to change this to null.​

This behavior is distinct from the nbstripout tool, which sets it to null, aligning with the Jupyter/IPYNB standard. The inability to change this in Databricks is known (and sometimes raised as a feature request) but remains a limitation of the platform at this time.​

If you need the execution count field to be null, you will need to use a separate stripping tool (such as a post-commit hook using nbstripout or a jq script) outside of Databricks, after the commit operation, to rewrite the field as desired.​

There is no practical advantage in retaining 0 over null for stripped cells; null is more compatible with standard tools and CI policies.​