Skip to content

BUG: Series constructor overflowing for UInt64 #50757

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

Merged
merged 9 commits into from
Jan 18, 2023
Merged

Conversation

phofl
Copy link
Member

@phofl phofl commented Jan 15, 2023

Not sure if there is a way to avoid loss of precision without using object in the mixed case. This does not impact the regular case without overflow risks

@phofl phofl added Bug NA - MaskedArrays Related to pd.NA and nullable extension arrays labels Jan 15, 2023
@phofl
Copy link
Member Author

phofl commented Jan 15, 2023

Yikes this is mean, it's not failing on Mac :)

)
tm.assert_series_equal(result, expected)

def test_series_constructor_overflow_int_with_nan(self):
Copy link
Member

Choose a reason for hiding this comment

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

should this be "uint" instead of "int"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thx, yes

@@ -2007,6 +2008,50 @@ def test_series_constructor_ea_int_from_string_bool(self):
with pytest.raises(ValueError, match="invalid literal"):
Series(["True", "False", "True", pd.NA], dtype="Int64")

@pytest.mark.parametrize("val", [1, 1.0])
def test_series_constructor_overflow_uint_ea(self, val):
Copy link
Member

Choose a reason for hiding this comment

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

do these tests go through meaningfully different paths? if not id suggest combining them. not a big deal

Copy link
Member Author

Choose a reason for hiding this comment

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

Expected is annoying to define in one df, so would prefer keeping it separate to make it easier to read

Copy link
Member

@jbrockmendel jbrockmendel left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug NA - MaskedArrays Related to pd.NA and nullable extension arrays
Projects
None yet
2 participants