Skip to content

Commit 7f45be9

Browse files
authored
Merge branch 'main' into migrate-to-gh-actions
2 parents 700b472 + d28f18e commit 7f45be9

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

plotly/express/_core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,8 @@ def make_trace_kwargs(args, trace_spec, trace_data, mapping_labels, sizeref):
588588
and attr_name == "z"
589589
):
590590
# ensure that stuff like "count" gets into the hoverlabel
591-
mapping_labels[attr_label] = "%%{%s}" % attr_name
591+
if attr_label is not None:
592+
mapping_labels[attr_label] = "%%{%s}" % attr_name
592593
if trace_spec.constructor not in [go.Parcoords, go.Parcats]:
593594
# Modify mapping_labels according to hover_data keys
594595
# if hover_data is a dict

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools>=61", "hatch", "jupyter_packaging~=0.10.0", "wheel"]
2+
requires = ["setuptools>=71"]
33
build-backend = "setuptools.build_meta"
44

55
[project.urls]

tests/test_optional/test_px/test_px_functions.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,3 +619,13 @@ def test_timeline_cols_already_temporal(constructor, datetime_columns):
619619
assert len(fig.data) == 3
620620
assert fig.layout.xaxis.type == "date"
621621
assert fig.layout.xaxis.title.text is None
622+
623+
624+
def test_empty_histogram():
625+
"""Empty px.histogram() should not raise, matching scatter/bar/pie behavior.
626+
627+
Regression test for https://github.com/plotly/plotly.py/issues/5534
628+
"""
629+
fig = px.histogram()
630+
assert len(fig.data) == 1
631+
assert fig.data[0].type == "histogram"

0 commit comments

Comments
 (0)