fix: display Duration and weird-type columns (#622)#635
Conversation
…622) Add type detection (duration, categorical, period, interval, binary) to v1 TypingStats, JS DurationDisplayer for human-readable formatting, serialization fixes for period/interval/timedelta/bytes columns, and partial-stats error recovery so non-critical failures don't blank the entire stats row. Pandas end-to-end support is complete; Polars type detection deferred to the v2 stats pipeline PR. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📦 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.12.12.dev23315711677or 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.12.12.dev23315711677MCP server for Claude Codeclaude mcp add buckaroo-table -- uvx --from "buckaroo[mcp]==0.12.12.dev23315711677" --index-strategy unsafe-best-match --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ buckaroo-table |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 157865ad9c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const m = iso.match( | ||
| /^P(?:(\d+)D)?T(?:(\d+)H)?(?:(\d+)M)?(?:([\d.]+)S)?$/ | ||
| ); | ||
| if (!m) return iso; // fallback to raw string |
There was a problem hiding this comment.
Parse pandas timedelta strings in the duration formatter
formatIsoDuration() only accepts ISO-8601 P…T…S strings, but the real widget data paths serialize durations as pandas repr strings instead: buckaroo/serialization_utils.py:127-128 does astype(str) for timedeltas, and buckaroo/polars_buckaroo.py:66-72 sends Polars durations through to_pandas() and the same serializer. In practice cells arrive as values like 1 days 02:03:04, so this formatter falls back to the raw string for every pandas (and current polars) duration column; the Storybook/Playwright coverage passes only because WeirdTypes.stories.tsx hard-codes ISO literals.
Useful? React with 👍 / 👎.
DFViewer/PolarsDFViewer don't run the analysis pipeline, so they never produce .histogram-component elements. The unconditional assertion added in f2147ce causes these notebooks to fail. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ines Add is_timedelta, is_categorical, is_period, is_interval, is_time, is_decimal, is_binary flags to pd_stats_v2 and pl_stats_v2 typing_stats functions so Duration, Time, Categorical, Decimal, and Binary columns get the correct _type and displayer mapping. Without this, the Polars pipeline misclassifies Duration as "datetime" and renders blank cells. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
formatDuration now handles both ISO 8601 ("P1DT2H3M4.5S") and pandas
timedelta repr ("1 days 02:03:04") formats. The serializer produces
pandas-style strings via astype(str), so without this the formatter
was falling back to the raw string for every real duration value.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
DurationDisplayerfor human-readable duration formatting in the gridPandas end-to-end is complete. Polars type detection requires the v2 stats pipeline and will land in a follow-up PR.
Closes #622
Test plan
🤖 Generated with Claude Code