Make the formatting of a code block name extendable #13817
Merged
+31
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently the user display of a code block requires a tight coupling between the caching compiler and the ultratb file, i.e., ultratb needs to know internal private variables of the caching compiler. This change makes the user-visible display of the code block name the responsibility of the caching compiler, separating the API more cleanly. A nice result is that the caching compiler can be overridden to have custom terminology in different systems for code blocks executed (for example, in Databricks the "cells" are currently known as "commands".)
I tried to strike a nice balance here between maintaining the existing format exactly and the API of the new method. I think it is a bit weird that the line number formatting is different for files vs cached code blocks (
X, line Y
vsX:Y
). Do we need to preserve theX:Y
formatting for automated tools that expect exactly that form for file line numbers?