Jupyter notebook diffs

I’ve been using GitLab to host internal projects at my university. About 4 years ago I setup GitLab, not sure the specific version, though I have kept updating the installation every month or two along the way. Currently on 16.5.2.

I have been working with python and Jupyter for several years, but due to how GitLab and git show notebook differences, I have been using Jupytext to automatically convert notebooks to markdown (or .py file format) before adding to a git repo for better diffing and preview.

I came across this information recently:

Based on the above link, GitLab newer than 15.6 should have a feature to render better diffs for notebook changes. I actually have 16.5, but am still seeing this when trying to view notebook diffs:

This source diff could not be displayed because it is too large. You can view the blob instead.

Perhaps it worked for a while but now does not due to change in Jupyter?

Anyone know if this is an Enterprise feature, rather than something available in the Community version?

If it is available for all, is there some hidden flag to enable it?

Well, the message you got is pretty clare: because it is too large. Did you try it with a smaller notebook?

This article says also, that it does not work, if the notebook is very large: Cleaner notebook diffs are not generated when the notebook is too large.

However, i do not know what is the limit and if its by LOC or filsize, e.g. when there are a lot of data or pictures in the outputs, the file can get quite large. It therefore may be a sloution to always delete all outputs before commiting/merging. Then, git will only show differences in the code/markdown and not just differences because of executing the notebook.

An other option is to use a tool for comparison like nbdime

…but you are right, I only can see this Cleaner notebook diffs in commits view, not in Merge request. But i found out, that you can open it in the Web IDE and get a quite nice view of the
image

There, you can also enable/disable output comparison: