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

Explore supporting **Run Dependent Cells** #14316

Open
rebornix opened this issue Sep 12, 2023 · 1 comment
Open

Explore supporting **Run Dependent Cells** #14316

rebornix opened this issue Sep 12, 2023 · 1 comment
Assignees
Labels
feature-request Request for new features or functionality on-testplan

Comments

@rebornix
Copy link
Member

rebornix commented Sep 12, 2023

Background

Efficiently handling cell dependencies has become a major challenge in today's data analysis and computational notebook landscape. As cells are interconnected, modification in one can affect others, making it critical to have a reliable way to manage and track these relationships. Our objective is to implement a mechanism that can identify and navigate dependencies between cells, thus enhancing the user workflow and data integrity within the notebook.

Proposal

We will introduce a new execution command, "Execute cell with dependent cells," which will intelligently identify and manage the execution of a cell and its dependent cells in a notebook.

To archive this, we would experiment with following techniques:

  • Leveraging Language Server Information: Use symbols and references from the language server to map and establish the grammatical connections between cells.
    • In order to understand how data flows, we will rely on both symbol info (where symbols are defined) and also references (specifically, distinguishing between write and read references) from the language server. For example, if cell A defines a symbol which is utilized by cell B, any modification in cell A necessitates a re-run of cell B, indicating a dependency of B on A. Similarly, if cell A involves a write reference to a symbol and cell B encompasses a read reference of the same, it is construed that B is dependent on A.
  • Build Dependency Graph with cell execution states: Develop a dynamic dependency graph that updates in real-time as cells are modified or executed, using both symbol/references information and historical execution sequences.

UX

  • Add the command "Execute cell with dependent cells" to the Cell Execution Toolbar.
  • Provide visual cues, such as notebook cell decorations or status bar items, to indicate which cells are now "stale".

Related Issues

@rebornix
Copy link
Member Author

First experiment has been checked into the main branch, should be available in next prerelease. Pylance extension prerelease is required and also we need to enable the jupyter.executionAnalysis.enabled setting and then reload the window. Issues we currently ran into:

  • We are requesting symbols through vscode.executeDocumentSymbolProvider, but module imports are not seen as symbols. Cells that define module imports (e.g. import pandas as pd) are recognized by either symbol or reference requests.
  • Function definitions are seen as read references other than write. This is different from x = 1 where x is a write reference.

@rebornix rebornix modified the milestones: October 2023, November 2023 Oct 26, 2023
@rebornix rebornix modified the milestones: November 2023, December 2023 Nov 30, 2023
@joaomoreno joaomoreno removed this from the December 2023 milestone Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality on-testplan
Projects
None yet
Development

No branches or pull requests

2 participants