Skip to content

Commit

Permalink
suggestion: cell id by hash
Browse files Browse the repository at this point in the history
  • Loading branch information
dmadisetti committed Feb 22, 2025
1 parent 1443d60 commit 64246e6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions marimo/_runtime/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from copy import copy, deepcopy
from multiprocessing import connection
from typing import TYPE_CHECKING, Any, Callable, Iterator, List, Optional, cast
from uuid import uuid4

from marimo import _loggers
from marimo._ast.cell import CellConfig, CellImpl
Expand Down Expand Up @@ -135,6 +134,7 @@
)
from marimo._runtime.validate_graph import check_for_errors
from marimo._runtime.win32_interrupt_handler import Win32InterruptHandler
from marimo._save.hash import hash_cell_execution, hash_function
from marimo._server.model import SessionMode
from marimo._server.types import QueueType
from marimo._sql.engines import SQLAlchemyEngine
Expand Down Expand Up @@ -682,8 +682,11 @@ def _install_execution_context(
ctx.execution_context = (
exec_ctx := ExecutionContext(cell_id, setting_element_value)
)
# TODO
with (
get_context().provide_ui_ids(str(cell_id)),
get_context().provide_ui_ids(
hash_cell_execution(cell_id, self.graph).hex()
),
redirect_streams(
cell_id,
stream=self.stream,
Expand Down Expand Up @@ -1848,7 +1851,7 @@ def debug(title: str, message: str) -> None:
LOGGER.debug("Executing RPC %s", request)
with (
self._install_execution_context(cell_id=function.cell_id),
ctx.provide_ui_ids(str(uuid4())),
ctx.provide_ui_ids(hash_function(function).hex()),
):
# Usually UI element IDs are deterministic, based on
# cell id, so that element values can be matched up
Expand Down

0 comments on commit 64246e6

Please sign in to comment.