From 778bee04b5d31ca0c70300dad3af0354053b9464 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Fri, 14 Oct 2022 22:46:10 +0200 Subject: [PATCH 1/2] fix FutureWarning: iteritems is deprecated and will be removed in a future version. Use .items instead. plotly/express/_core.py:279 --- packages/python/plotly/plotly/express/_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/python/plotly/plotly/express/_core.py b/packages/python/plotly/plotly/express/_core.py index dd2d53be1ed..98619bfaed2 100644 --- a/packages/python/plotly/plotly/express/_core.py +++ b/packages/python/plotly/plotly/express/_core.py @@ -278,7 +278,7 @@ def make_trace_kwargs(args, trace_spec, trace_data, mapping_labels, sizeref): if attr_name == "dimensions": dims = [ (name, column) - for (name, column) in trace_data.iteritems() + for (name, column) in trace_data.items() if ((not attr_value) or (name in attr_value)) and ( trace_spec.constructor != go.Parcoords From e79ea720044549af3f63966ea5c5aa95ff2227f4 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Fri, 14 Oct 2022 22:48:11 +0200 Subject: [PATCH 2/2] update py2 dict.iteritems() --- packages/python/chart-studio/chart_studio/plotly/plotly.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/python/chart-studio/chart_studio/plotly/plotly.py b/packages/python/chart-studio/chart_studio/plotly/plotly.py index 1e6257ab995..589b7aa1c85 100644 --- a/packages/python/chart-studio/chart_studio/plotly/plotly.py +++ b/packages/python/chart-studio/chart_studio/plotly/plotly.py @@ -430,7 +430,7 @@ def _swap_xy_data(data_obj): def byteify(input): """Convert unicode strings in JSON object to byte strings""" if isinstance(input, dict): - return {byteify(key): byteify(value) for key, value in input.iteritems()} + return {byteify(key): byteify(value) for key, value in input.items()} elif isinstance(input, list): return [byteify(element) for element in input] elif isinstance(input, unicode):