Skip to content

BUG: Fix na_rep when using pd.NA in _format_strings (#33950) #34565

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

Closed
wants to merge 1,025 commits into from
Closed

BUG: Fix na_rep when using pd.NA in _format_strings (#33950) #34565

wants to merge 1,025 commits into from

Conversation

k-fillmore
Copy link

@k-fillmore k-fillmore commented Jun 4, 2020

@k-fillmore k-fillmore changed the title add support for na_rep when using pd.NA in _format_strings See #33950 BUG: Add support for na_rep when using pd.NA in _format_strings (#33950) Jun 4, 2020
@k-fillmore k-fillmore changed the title BUG: Add support for na_rep when using pd.NA in _format_strings (#33950) BUG: Fix na_rep when using pd.NA in _format_strings (#33950) Jun 4, 2020
@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Jun 4, 2020

@k-fillmore thanks for the contribution!

Does this keep the correct "<NA>" representation by default? (when not using na_rep keyword)

Further, can you add a test for this?

@jorisvandenbossche jorisvandenbossche added IO HTML read_html, to_html, Styler.apply, Styler.applymap Output-Formatting __repr__ of pandas objects, to_string labels Jun 4, 2020
@k-fillmore
Copy link
Author

Hi, @jorisvandenbossche Doesn't appear to retain the "" representation. I've added an additional expression to address this. Working on tests.

@pep8speaks
Copy link

pep8speaks commented Jun 5, 2020

Hello @k-fillmore! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-06-05 22:52:41 UTC

@k-fillmore
Copy link
Author

@jorisvandenbossche added tests. Don't really like the leading whitespace that I had to add. But that's how they're being passed back from GenericArrayFormatter. I tried to track down where they're coming from but didnt have much luck. Any ideas?

@k-fillmore
Copy link
Author

Just want to follow up on this. Do I need to add anything else?

@TomAugspurger
Copy link
Contributor

#33950 (comment) noted that this affects NaT too. Can you fix that here or open a second issue?

@TomAugspurger
Copy link
Contributor

Can you also merge master and re-push. I don't know why CI failed last time. We also need a release note in whatsnew/1.2.0.rst.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2020

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

@github-actions github-actions bot added the Stale label Oct 5, 2020
@k-fillmore
Copy link
Author

Noted, working on NaT here. Will do a merge master and add change logs as requested.

dsaxton and others added 27 commits October 5, 2020 18:59
Noticed a minor typo when using the docs
* REF: extract func _select_upcast_cls_from_dtype

* REF: extract function _get_upcast_classes

* CLN: rename g -> common_dtype

* TYP: type extracted functions

* DOC: add docstrings to extracted methods

* TYP: cast instead of ignoring mypy error

* CLN: import SparseDtype only for type checking
* ENH: match stdlib behavior for datetimelike comparisons

* update test

Co-authored-by: Jeff Reback <jeff@reback.net>
* CI: Update error message for np_dev

* Comma

* Fix
Copy link
Member

@arw2019 arw2019 left a comment

Choose a reason for hiding this comment

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

@k-fillmore are you interested in continuing? If yes merge master (looks like you have merge issues atm) and we'll take another look

@arw2019
Copy link
Member

arw2019 commented Nov 4, 2020

Closing for now. @k-fillmore let us know whenever you'd like to continue and we'll reopen!

@arw2019 arw2019 closed this Nov 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO HTML read_html, to_html, Styler.apply, Styler.applymap Output-Formatting __repr__ of pandas objects, to_string Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: pd.NA ignored in DataFrame.to_html(na_rep)