WARN: Add FutureWarning for DataFrame.to_latex by attack68 · Pull Request #44411 · pandas-dev/pandas (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation6 Commits13 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

@attack68

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.

jreback

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

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

This was referenced

Nov 14, 2021

jreback

@jreback

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

@attack68

@attack68

jreback

- 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`)

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

@rhshadrach

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

@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

Labels

Compat

pandas objects compatability with Numpy or Python functions

Deprecate

Functionality to remove in pandas

IO LaTeX

to_latex