chore(widget): cross-stream bk-flash tracing + console cleanup#761
Merged
Conversation
…cleanup
Search-path debugging needs Python and JS log lines on the same timeline.
The JS side already had an opt-in `[bk-flash …]` tracer; this adds the
Python counterpart and harmonizes the timestamp format so the two
streams can be grep'd and interleaved.
- buckaroo/buckaroo_widget.py: `_bk_flash` helper gated by
`BUCKAROO_BK_FLASH` env var. Call sites in `_buckaroo_state`,
`_handle_widget_change`, `_handle_payload_args`.
- buckaroo/polars_buckaroo.py: `_bk_flash` in polars `_handle_payload_args`.
- BuckarooWidgetInfinite.tsx, DFViewerInfinite.tsx: switch
`performance.now()` to wall-clock `bkTs()` so JS lines line up with
Python's `[bk-flash-py HH:MM:SS.mmm]`. Make the gate runtime-checkable
(`bkFlashOn()`) so `globalThis.__BK_FLASH__ = true` works in DevTools
without a bundle reload. Add request/response boundary logs at
`model.send infinite_request` and `model.on infinite_resp`.
- SmartRowCache.ts: drop stray `debugger;` at verifyResp.
- Trim unconditional render-time bkLog calls (BuckarooInfiniteWidget
render, makeStaticInfiniteDs, fakeDs.getRows, getDataWrapper,
DFViewer{,Inner} render, datasource useMemo, AgGrid onModelUpdated /
onSortChanged / onGridReady, view_name effect when from===to) so the
signal-to-noise stays usable when the flag is on.
To enable: set `BUCKAROO_BK_FLASH=1` in the kernel env and
`globalThis.__BK_FLASH__ = true` in DevTools, then grep `[bk-flash` in
the browser console + kernel output.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 tasks
Contributor
📦 TestPyPI package publishedpip install --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo==0.14.0.dev25998518773or with uv: uv pip install --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo==0.14.0.dev25998518773MCP server for Claude Codeclaude mcp add buckaroo-table -- uvx --from "buckaroo[mcp]==0.14.0.dev25998518773" --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo-table📖 Docs preview🎨 Storybook preview |
3 tasks
paddymul
added a commit
that referenced
this pull request
May 17, 2026
CI's Python / Lint job runs `ruff check` + `paddy_format.py --check` over the entire `buckaroo/ tests/ scripts/` tree, but the local `paddy-format` pre-commit hook only sees staged files. Drift introduced by a recent merge to main (e.g. an unrelated PR that didn't run the formatter) only surfaces on CI for the next person to push, even if their own staged files are clean — exactly what happened to PR #761. Add a pre-push stage that mirrors CI's lint job, so the same full-tree check runs locally before push: - ruff-check-full: `uv run ruff check` (no file filter) - paddy-format-check-full: `--check` over the same find expression CI uses To activate locally, run `pre-commit install --hook-type pre-push` once (or `pre-commit install --install-hooks --hook-type pre-commit --hook-type pre-push`). Also reformat `tests/unit/dataflow/autocleaning_pl_test.py` which was the file CI flagged on #761. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extracted from #749. The JS side already had an opt-in
[bk-flash …]tracer; this adds the Python counterpart and harmonizes the timestamp format so the two streams can be grep'd and interleaved when debugging the search → request → response round-trip.What's in
_bk_flash(buckaroo/buckaroo_widget.py): wall-clock[bk-flash-py HH:MM:SS.mmm]to stderr, gated byBUCKAROO_BK_FLASH=1. Call sites in_buckaroo_state,_handle_widget_change,_handle_payload_args(pandas + polars).performance.now()for wall-clockbkTs()inBuckarooWidgetInfinite.tsxandDFViewerInfinite.tsxso JS lines align with Python timestamps. Gate is now runtime-checkable (bkFlashOn()per call), soglobalThis.__BK_FLASH__ = trueworks in DevTools without a bundle reload.model.send infinite_request → Pythonandmodel.on infinite_resp ← Python.bkLogcalls (BuckarooInfiniteWidget render, makeStaticInfiniteDs, fakeDs.getRows, getDataWrapper, DFViewer{,Inner} render, datasource useMemo, AgGrid onModelUpdated/onSortChanged/onGridReady, view_name effect when from===to). Keeps signal-to-noise usable when the flag is on.debugger;inSmartRowCache.ts:461.Enabling the trace
In the kernel:
In DevTools:
Then re-run the widget cell and grep
[bk-flashin both the browser console and kernel output.Test plan
pnpm run build:tsccleanpnpm test— 233 passpytest tests/unit/— 987 pass (1 unrelated build-artifact failure ontest_mcp_uvx_install.py::test_view_data_callreproduces on plain main and is deselected)BUCKAROO_BK_FLASH=1 pytest tests/unit/test_xorq_buckaroo_widget.py tests/unit/polars_basic_widget_test.py— 49 pass (verifies guards aroundlen(processed_df)don't blow up on xorq Ibis exprs)🤖 Generated with Claude Code