Skip to content

Python tracebacks: skip first DefaultExecutor.execute_cell item #6576

@yairchu

Description

@yairchu

Description

The traceback for any error in a Marimo Python cell starts with:

Traceback (most recent call last):
   File ".../site-packages/marimo/_runtime/executor.py", line 139, in execute_cell
    return eval(cell.last_expr, glbls)
  Cell marimo://<NOTEBOOK>#cell=<CELL>, line <LINE>, in <module>

As the first execute_cell traceback is always there it is not informative, and merely exposes a Marimo implementation details whereas the user would expect the cell to be the first traceback item

Suggested solution

Filter out the first traceback item of execute_cell

Are you willing to submit a PR?

  • Yes

Alternatives

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions