Execute a single cell. Executes a cell with the provided code. Dependent cells may be re-executed based on the reactive execution mode. Attributes: cell_id: Cell to execute. code: Python code to execute. request: HTTP request context if available. timest
| 222 | |
| 223 | |
| 224 | class ExecuteCellCommand(Command): |
| 225 | """Execute a single cell. |
| 226 | |
| 227 | Executes a cell with the provided code. Dependent cells may be |
| 228 | re-executed based on the reactive execution mode. |
| 229 | |
| 230 | Attributes: |
| 231 | cell_id: Cell to execute. |
| 232 | code: Python code to execute. |
| 233 | request: HTTP request context if available. |
| 234 | timestamp: Unix timestamp when command was created. |
| 235 | """ |
| 236 | |
| 237 | cell_id: CellId_t |
| 238 | code: str |
| 239 | # incoming request, e.g. from Starlette or FastAPI |
| 240 | request: HTTPRequest | None = None |
| 241 | timestamp: float = msgspec.field(default_factory=time.time) |
| 242 | |
| 243 | def __repr__(self) -> str: |
| 244 | preview = self.code[:10].replace("\n", " ") |
| 245 | return ( |
| 246 | f"ExecuteCellCommand(cell={self.cell_id}, code_preview={preview})" |
| 247 | ) |
| 248 | |
| 249 | |
| 250 | class ExecuteStaleCellsCommand(Command): |
no outgoing calls
searching dependent graphs…