Skip to content

BUG: Fix FloatingArray output formatting #36800

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 28 commits into from
Oct 16, 2020
Merged

BUG: Fix FloatingArray output formatting #36800

merged 28 commits into from
Oct 16, 2020

Conversation

dsaxton
Copy link
Member

@dsaxton dsaxton commented Oct 2, 2020

@simonjayhawkins simonjayhawkins added NA - MaskedArrays Related to pd.NA and nullable extension arrays Output-Formatting __repr__ of pandas objects, to_string labels Oct 2, 2020
@@ -3432,3 +3432,14 @@ def test_format_remove_leading_space_dataframe(input_array, expected):
# GH: 24980
df = pd.DataFrame(input_array).to_string(index=False)
assert df == expected


def test_nullable_float_to_string(float_ea_dtype):
Copy link
Contributor

Choose a reason for hiding this comment

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

i think should move these to EA tests and try to do these generically (for all of the numberic types); i guess ok here as well (but group them together int. & float both with and w/o nulls)

Copy link
Contributor

Choose a reason for hiding this comment

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

do we have int nullable tests for formatting?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not as far as I can tell, entirely possible I'm just missing them

Copy link
Contributor

Choose a reason for hiding this comment

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

kk can you add (this PR would be great)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done. These tests could probably be cleaned up a bit also, this file is very big and testing lots of different things.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh yes, for sure. if you'd create an issue would be great.

@dsaxton dsaxton marked this pull request as ready for review October 14, 2020 15:01
@jreback jreback added this to the 1.2 milestone Oct 15, 2020
@@ -3432,3 +3432,14 @@ def test_format_remove_leading_space_dataframe(input_array, expected):
# GH: 24980
df = pd.DataFrame(input_array).to_string(index=False)
assert df == expected


def test_nullable_float_to_string(float_ea_dtype):
Copy link
Contributor

Choose a reason for hiding this comment

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

do we have int nullable tests for formatting?

@jreback jreback merged commit c2a96c6 into pandas-dev:master Oct 16, 2020
@jreback
Copy link
Contributor

jreback commented Oct 16, 2020

thanks @dsaxton

@dsaxton dsaxton deleted the nullable-float-array-string-format branch October 16, 2020 01:48
@jorisvandenbossche
Copy link
Member

Thanks @dsaxton !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NA - MaskedArrays Related to pd.NA and nullable extension arrays Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Nullable floats can look like ints in repr
4 participants