-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improvement: handle pl.Duration #3274
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
} | ||
return ColumnSummary( | ||
total=total, | ||
nulls=col.null_count(), | ||
min=str(unit_map["us"]().min()) + "μs", | ||
max=str(unit_map["us"]().max()) + "μs", | ||
mean=str(unit_map["us"]().mean()) + "μs", | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might be worth factoring out the total_*
call, so it doesn't get recalculated?
duration = unit_map["us"]()
return ColumnSummary(
total=total,
nulls=col.null_count(),
min=str(duration.min()) + "μs",
max=str(duration.max()) + "μs",
mean=str(duration.mean()) + "μs",
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm modulo marco's comment
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.10.7-dev27 |
Fixes #3267
This handles narwhals and polars Duration types, by treating them as
floats
and not temporal. We differ in the that we don't show the units for each entry (just at the top).For pandas, we treat them as strings (with the same formatting as their plain HTML)