Commit f2147ce
test: assert histogram rendering in Playwright integration tests (#631)
* test: assert histogram DOM elements render in marimo and Jupyter integration tests
The existing Playwright tests exercise the full Python→serialize→JS→render
pipeline but only assert on data grid cells, row counts, and headers. They
never check that summary stats (histograms) actually render, which allowed
the parquet_b64 async regression (#630) to ship undetected.
Add .histogram-component visibility assertions to both marimo.spec.ts and
integration-batch.spec.ts. These will fail until #630 is fixed, proving
the test gap.
Refs: #630
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: cap fastparquet <2026.3.0 (missing x86_64 Linux wheels)
fastparquet 2026.3.0 (released 2026-03-17) ships without manylinux
x86_64 wheels or sdist, breaking installation on GitHub Actions Ubuntu
runners. Cap to <2026.3.0 until a fixed release is available.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: generate bigint-test.html for static embed Playwright test
The BigInt precision test (added in 44a2af1) navigates to
/bigint-test.html but the generation script only created
static-test.html. The test always timed out at 60s waiting for
AG-Grid cells on a nonexistent page.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: bigint test DataFrame needs enough rows for widget initialization
A 3-row DataFrame with only bigint values causes histogram computation
to fail ("Too many bins for data range"), leaving df_data_dict with only
['empty'] and no 'all_stats' key. to_html() then hits a KeyError.
Pad to 10 rows with a normal 'value' column so the widget fully
initializes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: handle np.histogram ValueError for large integers near 2^53
np.histogram(meat, 10) raises ValueError when float64 precision is
insufficient to create distinct bin edges. At values near 2^53,
np.spacing is 2.0, so the ±0.5 range numpy uses for single-value
binning collapses to zero width.
This affects any column with large integers (database PKs, snowflake
IDs) where percentile trimming leaves few values. Catch the ValueError
and return empty histogram_args, which falls through to categorical
histogram display.
Also reverts the bigint test DataFrame padding since the 3-row fixture
now works correctly.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* test: add unit tests for parquet_b64 summary stats round-trip (#630)
Python tests (test_sd_to_parquet_b64.py):
- sd_to_parquet_b64 returns tagged dict with correct format
- Scalar values round-trip through parquet encoding
- Histogram arrays survive encoding with correct types (numbers not strings)
- Categorical histogram data round-trips correctly
- Multiple columns are handled
JS tests (resolveDFData.test.ts):
- Null/undefined/plain-array pass-through
- hyparquet can decode Python-generated parquet_b64 fixture
- Histogram JSON round-trips with correct types after parquet decode
- resolveDFDataAsync returns non-empty decoded data
- **resolveDFData (sync) returns non-empty data** — this test FAILS,
proving #630: parquetRead is async so the sync wrapper returns []
Jest config: add hyparquet ESM module resolution + TextDecoder polyfill.
Refs: #630
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: revert summary stats to JSON serialization (#630)
The parquet_b64 transport for summary stats (PR #488) broke histograms
and all summary stats in both Jupyter and marimo. hyparquet's
parquetRead is async, so the synchronous resolveDFData() returned []
before the decode callback fired.
Revert all widget _sd_to_jsondf() methods and _summary_to_rows() back
to pd_to_obj(pd.DataFrame(sd)) which produces plain JSON arrays. The
JS resolveDFData() passes arrays through unchanged (Array.isArray path).
The static embed path (artifact.py → BuckarooStaticTable.tsx) is
unaffected — it uses resolveDFDataAsync() which properly awaits.
Summary stats DataFrames are small, so JSON transport has negligible
performance impact vs parquet.
Fixes: #630
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Revert "fix: revert summary stats to JSON serialization (#630)"
This reverts commit cdce878.
* fix: use async parquet decode for summary stats in widget components (#630)
The sync resolveDFData() returns [] because hyparquet's parquetRead is
async. Instead of reverting to JSON, add a useResolvedDFDataDict React
hook that:
1. Tries sync decode first (works for plain arrays and cached data)
2. Falls back to async resolveDFDataAsync if parquet_b64 returned []
3. Re-renders when async decode completes
Updated all widget entry points:
- DCFCell: useResolvedDFDataDict instead of resolveDFData
- BuckarooInfiniteWidget: same
- DFViewerInfiniteDS: same
- widget.tsx renderDFV: same
getDataWrapper now takes a pre-resolved dict instead of calling
resolveDFData internally.
Also fixes Python lint (unused imports in test_sd_to_parquet_b64.py).
Fixes: #630
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: drop ?? [] fallbacks — missing keys should surface as errors
The resolved dict always has every key from df_data_dict. A missing
key means a real bug (wrong data_key config, widget state mismatch)
that should be visible, not silently masked with an empty array.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: pre-decode parquet_b64 at widget mount, not in React components
Replace the useResolvedDFDataDict hook with a simpler approach:
createPredecodingRender() decodes all parquet_b64 entries in
df_data_dict ONCE via preResolveDFDataDict() before React mounts,
and re-decodes on model changes.
React components now receive plain DFData arrays and never deal with
parquet_b64 — no hooks, no async, no empty-frame flash.
- widget.tsx: new createPredecodingRender() that awaits decode before
React.createElement, used by BuckarooWidget, BuckarooInfiniteWidget,
and DFViewerInfiniteDS render paths
- DCFCell, BuckarooWidgetInfinite: revert to plain df_data_dict[key]
access (no resolveDFData, no hook)
- Remove useResolvedDFDataDict.ts — no longer needed
Fixes: #630
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: move histogram assertion to integration.spec.ts (the one CI runs)
Codex correctly noted that CI runs integration.spec.ts per-notebook,
not integration-batch.spec.ts. Move the histogram assertion to the
file that actually executes in the Jupyter Playwright job.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 0bf6253 commit f2147ce
14 files changed
Lines changed: 346 additions & 34 deletions
File tree
- buckaroo/customizations
- packages
- buckaroo-js-core
- pw-tests
- src/components
- DFViewerParts
- test-fixtures
- js
- scripts
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
135 | 141 | | |
136 | 142 | | |
137 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | | - | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
189 | 196 | | |
190 | 197 | | |
191 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
121 | 137 | | |
Lines changed: 10 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | | - | |
| 25 | + | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | | - | |
| 36 | + | |
38 | 37 | | |
39 | 38 | | |
40 | | - | |
41 | | - | |
| 39 | + | |
| 40 | + | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
| |||
123 | 122 | | |
124 | 123 | | |
125 | 124 | | |
126 | | - | |
| 125 | + | |
127 | 126 | | |
128 | 127 | | |
129 | 128 | | |
| |||
160 | 159 | | |
161 | 160 | | |
162 | 161 | | |
163 | | - | |
| 162 | + | |
164 | 163 | | |
165 | | - | |
| 164 | + | |
166 | 165 | | |
167 | 166 | | |
168 | 167 | | |
| |||
220 | 219 | | |
221 | 220 | | |
222 | 221 | | |
223 | | - | |
| 222 | + | |
224 | 223 | | |
225 | 224 | | |
226 | 225 | | |
| |||
251 | 250 | | |
252 | 251 | | |
253 | 252 | | |
254 | | - | |
| 253 | + | |
255 | 254 | | |
256 | 255 | | |
257 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | | - | |
| 29 | + | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
48 | | - | |
49 | | - | |
| 47 | + | |
| 48 | + | |
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
| |||
Lines changed: 103 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments