Skip to content

Commit 5c7173e

Browse files
committed
use a mock comm to prevent type check errors
1 parent b587b14 commit 5c7173e

File tree

1 file changed

+17
-2
lines changed
  • extensions/positron-python/python_files/posit/positron

1 file changed

+17
-2
lines changed

extensions/positron-python/python_files/posit/positron/variables.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,10 +734,25 @@ def _summarize_data(self, path: list[str]):
734734
if not _value_type_is_supported(value):
735735
raise ValueError(f"Variable at '{path}' is not supported for summary")
736736

737-
# Create a temporary table view without a comm
737+
# Create a temporary table view with mock comm
738738
temp_state = DataExplorerState("temp_summary")
739739
try:
740-
table_view = _get_table_view(value, None, temp_state, self.kernel.job_queue)
740+
741+
class _MockBaseComm:
742+
def __init__(self):
743+
self.comm_id = "temp_summary_comm"
744+
745+
def send(self, data):
746+
pass # No-op for temporary summary
747+
748+
def on_close(self, callback):
749+
pass # No-op for temporary summary
750+
751+
from .positron_comm import PositronComm
752+
753+
mock_comm = PositronComm(_MockBaseComm())
754+
755+
table_view = _get_table_view(value, mock_comm, temp_state, self.kernel.job_queue)
741756
except Exception as e:
742757
raise ValueError(f"Failed to create table view: {e}") from e
743758

0 commit comments

Comments
 (0)