Skip to content

fix(integrations): use current python interpreter in notebook UI launcher (#981) - #996

Open
legend91019 wants to merge 1 commit into
apache:mainfrom
legend91019:fix/issue-981-notebook-python-interpreter
Open

legend91019 wants to merge 1 commit into
apache:mainfrom
legend91019:fix/issue-981-notebook-python-interpreter

Conversation

@legend91019

Copy link
Copy Markdown

Proposed Changes

Fixes #981.

In notebook environments (Jupyter, Colab, VSCode), virtual environments may be active for the notebook kernel without having their binary path activated in the notebook server's or system PATH.
Previously, launch_ui_jupyter() and launch_ui_colab() spawned the background server process using the literal "python" command:

subprocess.Popen(["python", "-c", ...])

This causes the subprocess to execute under whatever python is resolved on the parent PATH, which may lack apache-burr or dependencies, causing %burr_ui to fail to start the server.

This PR:

  1. Updates launch_ui_jupyter() and launch_ui_colab() in burr/integrations/notebook.py to use sys.executable or "python", guaranteeing that the tracking server runs inside the active notebook kernel's Python environment.
  2. Adds unit and regression tests in tests/integrations/test_notebook.py validating that sys.executable is passed to subprocess.Popen and that fallback to "python" works when the executable path is empty.

Verification

  • Added tests/integrations/test_notebook.py covering Jupyter and Colab UI launchers.
  • Verified Red phase: tests failed when literal "python" was passed instead of sys.executable.
  • Verified Green phase: 5/5 tests passed with uv run pytest tests/integrations/test_notebook.py.
  • Verified ASF license headers via python scripts/check_asf_headers.py.

…cher (apache#981)

- Update launch_ui_colab and launch_ui_jupyter to use sys.executable (fallback to 'python') instead of hardcoded 'python' literal
- Ensure Burr tracking server subprocess uses the active notebook kernel environment
- Add unit and regression tests in tests/integrations/test_notebook.py
@github-actions github-actions Bot added the area/integrations External integrations (LLMs, frameworks) label Oct 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/integrations External integrations (LLMs, frameworks)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Notebook UI launcher should use the current Python interpreter

1 participant