Commit c10fb9c
committed
fix: handle empty histogram() by skipping None label in hover template
When px.histogram() is called with no data arguments, the histogram-
specific hover label path inserts a None key into mapping_labels
(because attr_label is None when no column is specified). The hover
template list comprehension then fails with:
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
Skip adding to mapping_labels when attr_label is None, consistent
with how other chart types handle empty invocations.
Fixes #55341 parent c7bffb9 commit c10fb9c
File tree
2 files changed
+12
-1
lines changed- plotly/express
- tests/test_optional/test_px
2 files changed
+12
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
588 | 588 | | |
589 | 589 | | |
590 | 590 | | |
591 | | - | |
| 591 | + | |
| 592 | + | |
592 | 593 | | |
593 | 594 | | |
594 | 595 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
0 commit comments