Skip to content

Fix mo.ui.dataframe showing incorrect column count#7845

Merged
mscolnick merged 1 commit intomarimo-team:mainfrom
AnirudhDagar:fix_column_size
Jan 15, 2026
Merged

Fix mo.ui.dataframe showing incorrect column count#7845
mscolnick merged 1 commit intomarimo-team:mainfrom
AnirudhDagar:fix_column_size

Conversation

@AnirudhDagar
Copy link
Contributor

📝 Summary

mo.ui.dataframe was displaying "0 columns" in the footer, even though the data rendered correctly. After applying transforms like "Select Columns", the column count also didn't update to reflect the filtered columns.

🔍 Description of Changes

The column count was being calculated using Object.keys(columns).length but because it is a Map, .keys() returns an empty array, and hence the zero length. Updated to use field_types.length from the get_dataframe() response instead. This correctly reflects the actual columns being displayed, including after transforms are applied.

Screenshot

Before
image

After
image

Note: I've not added any specific tests for this, since it's a minor bug fix.

📋 Checklist

  • I have read the contributor guidelines.
  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • Tests have been added for the changes made.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Pull request title is a good summary of the changes - it will be used in the release notes.

@vercel
Copy link

vercel bot commented Jan 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jan 15, 2026 9:27am

@mscolnick mscolnick added the bug Something isn't working label Jan 15, 2026
@mscolnick mscolnick merged commit f71f759 into marimo-team:main Jan 15, 2026
25 of 28 checks passed
@AnirudhDagar AnirudhDagar deleted the fix_column_size branch January 15, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants