Skip to content

Commit f102998

Browse files
committed
rm to_py_scalar call in for loop -> fix Pie performances
1 parent c320c46 commit f102998

File tree

1 file changed

+1
-2
lines changed
  • packages/python/plotly/plotly/express

1 file changed

+1
-2
lines changed

packages/python/plotly/plotly/express/_core.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,7 @@ def make_trace_kwargs(args, trace_spec, trace_data, mapping_labels, sizeref):
532532
mapping = args["color_discrete_map"].copy()
533533
else:
534534
mapping = {}
535-
for cat in trace_data.get_column(attr_value):
536-
cat = nw.to_py_scalar(cat)
535+
for cat in trace_data.get_column(attr_value).to_list():
537536
if mapping.get(cat) is None:
538537
mapping[cat] = args["color_discrete_sequence"][
539538
len(mapping) % len(args["color_discrete_sequence"])

0 commit comments

Comments
 (0)