Skip to content

fix: suppress RuntimeWarning for all-NaN DataFrame columns#8217

Merged
mscolnick merged 1 commit intomarimo-team:mainfrom
AhmadYasser1:fix/nan-column-warning
Feb 10, 2026
Merged

fix: suppress RuntimeWarning for all-NaN DataFrame columns#8217
mscolnick merged 1 commit intomarimo-team:mainfrom
AhmadYasser1:fix/nan-column-warning

Conversation

@AhmadYasser1
Copy link
Contributor

Summary

Console was spammed with "Mean of empty slice" and "Degrees of freedom <= 0" RuntimeWarnings when computing statistics over all-NaN DataFrame columns. Wraps the computation in a warning suppressor.

Closes #7046

Test Plan

  • Added test verifying no RuntimeWarning is raised for all-NaN columns
Wrap `stats.collect()` in `warnings.catch_warnings()` to suppress
"Mean of empty slice" and "Degrees of freedom" RuntimeWarnings that
are raised when computing summary statistics on columns containing
only NaN values.

Closes marimo-team#7046
@mscolnick mscolnick added the bug Something isn't working label Feb 10, 2026
@mscolnick mscolnick merged commit e31a152 into marimo-team:main Feb 10, 2026
29 of 44 checks passed
@AhmadYasser1 AhmadYasser1 deleted the fix/nan-column-warning branch February 10, 2026 03:16
@github-actions
Copy link

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.19.10-dev30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

2 participants