You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support for inline values has been added for notebooks, using the setting notebook.inlineValues. When enabled, after a cell is executed, inline values will be displayed after the line, according to either any registered InlineValueProvider or the default fallback which simply does regex matching against the variables stored in the kernel after that execution. The latter may
Steps to Test:
Part 1:
Enable the setting notebook.inlineValues
Execute a cell, ensuring that inline values are presented similar to how they would be during the debugging process, with different styling.
when running more complex cells, it is expected that these values can and will be incorrect. This is due to the values all being retrieved from the kernel state after the cell has been executed. Local functions will have clearly incorrect values, as they are just matched via regex according to the variable name, without any concept of scope.
More advanced examples can perform more effective symbol matching, ignore python keywords, avoid local functions, etc. Values can be retrieved from the kernel using inline variable lookups, or statically determined and returned as inline variable text. Be sure to test both.
An example of a more complex cell, and the difference between the standard regex fallback vs the pylance provider:
the fallback regex matching will often show more incorrect values than correct ones, leading to visual fatigue and overall not much useful info (lower in the cell will be more useful): Improve notebook inline value fallback #238912
inline values for dataframes can stretch past the viewport
dataframes can render with broken LF characeters (\n), and render with an excessive amount of whitespace
Thanks for testing!
The text was updated successfully, but these errors were encountered:
Local functions will have clearly incorrect values, as they are just matched via regex according to the variable name, without any concept of scope.
While I am not a notebook user this statement caught my eyes. I think that, in general we should never show content that we know, or have high confidence that it may be incorrect due to known limitations. If we render any inline values we should do so when we have high confidence that the value is correct.
Refs: #237263
Complexity: 4
author: @Yoyokrazy
Create Issue
Summary
Support for inline values has been added for notebooks, using the setting
notebook.inlineValues
. When enabled, after a cell is executed, inline values will be displayed after the line, according to either any registeredInlineValueProvider
or the default fallback which simply does regex matching against the variables stored in the kernel after that execution. The latter maySteps to Test:
Part 1:
notebook.inlineValues
Part 2:
An example of a more complex cell, and the difference between the standard regex fallback vs the pylance provider:
pylance provider
fallback (regex matching)
cell content
Known Issues
Thanks for testing!
The text was updated successfully, but these errors were encountered: