Skip to content

Commit

Permalink
Clean up comm result
Browse files Browse the repository at this point in the history
  • Loading branch information
timtmok committed Apr 1, 2024
1 parent 872851f commit 94c34e9
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Check failure on line 104 in extensions/positron-python/pythonFiles/positron/positron_ipykernel/plots.py

View workflow job for this annotation

GitHub Actions / Check Python types

Argument of type "Literal['image/png']" cannot be assigned to parameter "__key" of type "slice" in function "__getitem__"   "Literal['image/png']" is incompatible with "slice" (reportGeneralTypeIssues)
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}")
Expand Down Expand Up @@ -213,7 +213,7 @@ def _resize_pickled_figure(

if was_interactive:
plt.ion()
return (format_dict, {})
return format_dict

Check failure on line 216 in extensions/positron-python/pythonFiles/positron/positron_ipykernel/plots.py

View workflow job for this annotation

GitHub Actions / Check Python types

Expression of type "dict[str, str]" cannot be assigned to return type "Tuple[dict[Unknown, Unknown], dict[Unknown, Unknown]]"   "dict[str, str]" is incompatible with "Tuple[dict[Unknown, Unknown], dict[Unknown, Unknown]]" (reportGeneralTypeIssues)

def _is_figure_empty(self, figure):
children = figure.get_children()
Expand Down

0 comments on commit 94c34e9

Please sign in to comment.