Skip to content
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

fix(rust): don't return NaN as free memory fraction #13860

Merged
merged 2 commits into from
Jan 22, 2024

Conversation

ByteNybbler
Copy link
Contributor

fixes #12424

@github-actions github-actions bot added fix Bug fix rust Related to Rust Polars labels Jan 19, 2024
0.0
} else {
// We divide first to reduce the precision loss in floats.
let available_at_start = (self.available_at_start / TO_MB) as f64;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we just add 1.0 to available at start? That should resolve it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, that also means we don't have to branch.

@ritchie46 ritchie46 merged commit 08bfbca into pola-rs:main Jan 22, 2024
16 of 17 checks passed
r-brink pushed a commit to r-brink/polars that referenced this pull request Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MemTracker::free_memory_fraction_since_start can return NaN
2 participants