Skip to content

Fixes issue with valid Notebooks not diffing

What does this MR do and why?

The diffing library was not taking into account that notebook code cells can have no output entry, and assumed there would be an empty output entry instead, which was causing errors

How to set up and validate locally

  1. On a test project, create a commit with the following file (naming it test.ipynb):
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "source": [
    "print(\"hello\")"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
  1. Open the commit, without the changes it should display an error that the diff was not generated. With the change, the diff renders without an issue:

image

Related to #381650 (closed)

Edited by Eduardo Bonet

Merge request reports