-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
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
Conversation
pandas/core/generic.py
Outdated
"use `DataFrame.style.to_latex` which also contains additional " | ||
"functionality." | ||
) | ||
warnings.warn(msg, FutureWarning, stacklevel=2) |
There was a problem hiding this comment.
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
looks fine can you add a whatsnew note in the deprecation section to message this. ping on green. |
doc/source/whatsnew/v1.4.0.rst
Outdated
@@ -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`) |
There was a problem hiding this comment.
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 :->
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. |
@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 |
see #47970 (comment) |
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.