Skip to content

Conversation

allecole
Copy link

@allecole allecole commented Aug 8, 2025

PR Requirements

Issue Description

Performing binary operations on larger Series with dtype == 'float32' leads to unexpected upcasts to float64.
Above example prints float32 float64.
Using to_numpy() on the series before addition inhibits the implicit upcast.

Expected Behavior

I expect above snippet to print float32 float32.

Bug Fix

Changed scalar conversion logic for NumPy floating scalars to avoid automatic conversion to Python float. Now returns a scalar of the original NumPy dtype to preserve type and prevent unintended dtype upcasts.

@allecole
Copy link
Author

allecole commented Aug 8, 2025

pre-commit.ci autofix

Copy link
Contributor

github-actions bot commented Sep 8, 2025

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label Sep 8, 2025
@mroeschke
Copy link
Member

Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.

@mroeschke mroeschke closed this Oct 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: Implicit upcast to float64 for large series (more than 1000000 rows)

2 participants