legend91019 opened a new pull request, #996:
URL: https://github.com/apache/burr/pull/996

   ## 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:
   ```python
   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`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to