From 94c34e924d93f5d16bd0473b506033832ae927a5 Mon Sep 17 00:00:00 2001 From: Tim Mok Date: Mon, 1 Apr 2024 16:46:16 -0400 Subject: [PATCH] Clean up comm result --- .../pythonFiles/positron/positron_ipykernel/plots.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/positron-python/pythonFiles/positron/positron_ipykernel/plots.py b/extensions/positron-python/pythonFiles/positron/positron_ipykernel/plots.py index 3000ddc3d6af..6ab50a273b09 100644 --- a/extensions/positron-python/pythonFiles/positron/positron_ipykernel/plots.py +++ b/extensions/positron-python/pythonFiles/positron/positron_ipykernel/plots.py @@ -98,12 +98,12 @@ def handle_msg(self, msg: CommMessage[PlotBackendMessageContent], raw_msg: JsonR pixel_ratio = request.params.pixel_ratio or 1.0 if width_px != 0 and height_px != 0: - format_dict, md_dict = self._resize_pickled_figure( + format_dict = self._resize_pickled_figure( pickled, width_px, height_px, pixel_ratio ) data = format_dict["image/png"] output = PlotResult(data=data, mime_type="image/png").dict() - figure_comm.send_result(data=output, metadata=md_dict) + figure_comm.send_result(data=output, metadata={"mime_type": "image/png"}) else: logger.warning(f"Unhandled request: {request}") @@ -213,7 +213,7 @@ def _resize_pickled_figure( if was_interactive: plt.ion() - return (format_dict, {}) + return format_dict def _is_figure_empty(self, figure): children = figure.get_children()