Skip to content

fix: display Duration and weird-type columns (#622)#635

Merged
paddymul merged 4 commits intomainfrom
fix/duration-display-clean
Mar 19, 2026
Merged

fix: display Duration and weird-type columns (#622)#635
paddymul merged 4 commits intomainfrom
fix/duration-display-clean

Conversation

@paddymul
Copy link
Copy Markdown
Collaborator

Summary

  • Add type detection for duration, categorical, period, interval, and binary columns to v1 TypingStats (pandas)
  • Add JS DurationDisplayer for human-readable duration formatting in the grid
  • Fix serialization of period/interval/timedelta/bytes columns (parquet + JSON)
  • Add partial-stats error recovery so a single column failure doesn't blank all stats
  • Storybook story + Playwright tests for weird-type rendering
  • Widget-level regression tests for both pandas and polars

Pandas 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

  • Python unit tests pass (623 passed)
  • JS unit tests pass (89 passed)
  • Ruff lint clean
  • CI: JupyterLab Playwright tests
  • CI: Storybook Playwright tests (weird-types.spec.ts)

🤖 Generated with Claude Code

…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>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 19, 2026

📦 TestPyPI package published

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.dev23315711677

or 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.dev23315711677

MCP server for Claude Code

claude 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

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +180 to +183
const m = iso.match(
/^P(?:(\d+)D)?T(?:(\d+)H)?(?:(\d+)M)?(?:([\d.]+)S)?$/
);
if (!m) return iso; // fallback to raw string
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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>
@paddymul paddymul added this pull request to the merge queue Mar 19, 2026
Merged via the queue into main with commit 512928e Mar 19, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

duration column not shown in PolarsBuckarooWidget

1 participant