Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Descendant cells executed regardless of mo.stop #3139

Closed
jakub-mikians-airspace-intelligence opened this issue Dec 12, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@jakub-mikians-airspace-intelligence
Copy link

jakub-mikians-airspace-intelligence commented Dec 12, 2024

Describe the bug

Hi!

In the documentation it writes that stopstops "any descendants of this cell that were previously scheduled to run will not be run" . Now I run the following simple code with stop condition, and I see the last cell (the descendant, correct?) that is still being executed.

The expected outcome is that the last cell is not executed. Or did I read the documentation incorrectly? If that is not the purpose of mo.stop, then please clarify in the doc how to stop execution of all the cells below the one that is meant to stop the program.

Image

Environment

{
  "marimo": "0.9.33",
  "OS": "Linux",
  "OS Version": "6.10.4-linuxkit",
  "Processor": "",
  "Python Version": "3.11.11",
  "Binaries": {
    "Browser": "--",
    "Node": "--"
  },
  "Dependencies": {
    "click": "8.1.7",
    "docutils": "0.21.2",
    "itsdangerous": "2.2.0",
    "jedi": "0.19.2",
    "markdown": "3.7",
    "narwhals": "1.14.2",
    "packaging": "24.1",
    "psutil": "6.1.0",
    "pygments": "2.18.0",
    "pymdown-extensions": "10.12",
    "pyyaml": "6.0.2",
    "ruff": "0.8.0",
    "starlette": "0.41.3",
    "tomlkit": "0.13.2",
    "typing-extensions": "4.12.2",
    "uvicorn": "0.32.1",
    "websockets": "14.1"
  },
  "Optional Dependencies": {
    "altair": "5.5.0",
    "pandas": "2.2.3",
    "pyarrow": "18.0.0"
  }
}

Code to reproduce

import marimo

__generated_with = "0.9.33"
app = marimo.App(width="medium")


@app.cell
def __():
    import marimo as mo
    return (mo,)


@app.cell
def __(mo):
    mo.stop(True, mo.md("stopped execution"))
    return


@app.cell
def __(mo):
    mo.md("""hey, I am still visible, although I am a descendant of the other cell""")
    return


if __name__ == "__main__":
    app.run()
@jakub-mikians-airspace-intelligence jakub-mikians-airspace-intelligence added the bug Something isn't working label Dec 12, 2024
@jakub-mikians-airspace-intelligence jakub-mikians-airspace-intelligence changed the title Descendant cells executed regardoess of mo.stop Descendant cells executed regardless of mo.stop Dec 12, 2024
@mscolnick
Copy link
Contributor

@jakub-mikians-airspace-intelligence

The bottom markdown is not a dependency of the cell prior. Descendants are not "below" one another but rather reference a variable that another cell declares (like excel, descendants are not lower on the spreadsheet).

You can learn more about that here: https://docs.marimo.io/guides/reactivity.html#references-and-definitions

@jakub-mikians-airspace-intelligence

Got it! Thanks for explanation and sorry for bothering then, cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants