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
Although one may construct an NdOverlay that has a key dimension of type bool, attempting to render it raises TypeError: sequence item 0: expected str instance, bool found.
For example, within a Jupyter notebook, the following constructs and renders a HoloMap by grouping over a bool dimension in the data, and the rendering sensibly shows string representations of the bool values in both the chart title and selector:
That behavior arrived with PR #4946, specifically with the removal of a unicode call within Dimension.pprint_value that coerced anything to a string. Prior to that PR, pprint_value returned a string, and rendering succeeded. The bug might be resolved by again coercing the formatted output to a string, by adding Dimension.type_formatters[bool] = str to "holoviews/core/__init__.py", or with other approaches.
One work-around is to add a value formatter to the key dimension by re-dimensioning the NdOverlay:
To summarize, a change in how reprs are formatted to string means legend generation is failing. I think we need to register a general formatter for booleans or figure out whether that unicode (or str) call should be reintroduced.
At any rate, pprint_value should never return anything except strings!
The conda environment's packages are collapsed here.
Although one may construct an
NdOverlay
that has a key dimension of typebool
, attempting to render it raisesTypeError: sequence item 0: expected str instance, bool found
.For example, within a Jupyter notebook, the following constructs and renders a
HoloMap
by grouping over abool
dimension in the data, and the rendering sensibly shows string representations of thebool
values in both the chart title and selector:Also, an
NdLayout
derived from theHoloMap
shows string representations in the chart titles:One may construct an
NdOverlay
without error:However, rendering it raises a
TypeError
:ndoverlay
(For brevity, I've used a plain traceback and abbreviated the paths.)
The
TypeError
arises from the key dimension'spprint_value
method returningbool
output forbool
input:That behavior arrived with PR #4946, specifically with the removal of a
unicode
call withinDimension.pprint_value
that coerced anything to a string. Prior to that PR,pprint_value
returned a string, and rendering succeeded. The bug might be resolved by again coercing the formatted output to a string, by addingDimension.type_formatters[bool] = str
to "holoviews/core/__init__.py", or with other approaches.One work-around is to add a value formatter to the key dimension by re-dimensioning the
NdOverlay
:The text was updated successfully, but these errors were encountered: