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

WARN: Add FutureWarning for DataFrame.to_latex #44411

Merged
merged 13 commits into from Nov 24, 2021

Conversation

attack68
Copy link
Contributor

@attack68 attack68 commented Nov 12, 2021

Instead of #41648, which performs a refactor and adds the warning in the same PR, I am proposing adding the warning only for 1.4.0 and then in 2.0 there will be scope to make breaking changes and refactor the arguments signature.

"use `DataFrame.style.to_latex` which also contains additional "
"functionality."
)
warnings.warn(msg, FutureWarning, stacklevel=2)
Copy link
Contributor

Choose a reason for hiding this comment

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

use find_stack_level here

@jreback jreback added Compat pandas objects compatability with Numpy or Python functions IO LaTeX to_latex labels Nov 13, 2021
@jreback jreback added this to the 1.4 milestone Nov 13, 2021
@jreback jreback added the Deprecate Functionality to remove in pandas label Nov 20, 2021
@jreback
Copy link
Contributor

jreback commented Nov 20, 2021

looks fine can you add a whatsnew note in the deprecation section to message this. ping on green.

@@ -465,6 +465,7 @@ Other Deprecations
- Deprecated the 'errors' keyword argument in :meth:`Series.where`, :meth:`DataFrame.where`, :meth:`Series.mask`, and meth:`DataFrame.mask`; in a future version the argument will be removed (:issue:`44294`)
- Deprecated :meth:`PeriodIndex.astype` to ``datetime64[ns]`` or ``DatetimeTZDtype``, use ``obj.to_timestamp(how).tz_localize(dtype.tz)`` instead (:issue:`44398`)
- Deprecated :meth:`DateOffset.apply`, use ``offset + other`` instead (:issue:`44522`)
- A deprecation warning is now shown for :meth:`DataFrame.to_html` indicating the arguments signature may change and emulate more the arguments to :meth:`.Styler.to_html` in future versions (:issue:`44411`)
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm this should be for to_latex :->

@attack68 attack68 merged commit 53eeaff into pandas-dev:master Nov 24, 2021
@attack68 attack68 deleted the depr_to_html_to_latex branch November 24, 2021 06:20
@rhshadrach
Copy link
Member

I didn't stumble upon this until today; this warning is emitted every time a user uses this method even though this method is not deprecated. The message itself says the arguments may change, and doesn't give any indication how. I think the bar for disrupting users (especially those that have a CI that fails on warnings) needs to be set higher.

@mroeschke
Copy link
Member

mroeschke commented Nov 18, 2022

@attack68 do you have bandwidth/appetite to align DataFrame.to_latex and Styler.to_latex since 2.0 will be the next version? If not, I suppose we should remove this warning for 2.0

@attack68
Copy link
Contributor Author

see #47970 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Deprecate Functionality to remove in pandas IO LaTeX to_latex
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants