-
-
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
DISC: deprecate notebook parameter in to_html() #23820
Comments
This is already documented in the API in development: I'm not clear by the issue if you are asking whether it should be documented or deprecated altogether, though I would be -1 on deprecation (clarification would be helpful). |
i'm not au fait with the deprecation process, hence opened an issue to start a discussion. i assume that if deprecation is agreed then a deprecation warning is issued in the next release and the change is not made for a couple of releases. I hadn't thought about just removing it from the documentation... that could be a good start. personally, I don't think it's necessary from a user perspective (i.e from df.to_html()) and hence removing it would simplify the API. from a code perspective, i'm looking to make This could naturally evolve in time with enhancements and feature requests into separate subclasses of |
I'll admit I'm not terribly familiar with this parameter nor its usage. If you have a code cleanup in mind though I suppose a PR is the best way to go about it unless one of the other core devs objects to the possibility of deprecation here. To answer your question about deprecation, yes we typically issue a |
i'll aim to put a draft PR together for the deprecation shortly. I'd like to have a base class for to_html that is shared with NotebookFormatter rather than the current situation where HTMLFormatter is the base class of NotebookFormatter. Having notebook parameter in to_html() method effectively means that all the functionality of to_html has to be available with notebook=True option and limits divergence in functionality. |
@simonjayhawkins if I am correct, what the |
It just adds a
Yes. to_markdown() would be better. a couple of issues.
Both these issues could still be addressed without deprecating the notebook argument. The first was effectively started with this PR. It is necessary to dispatch to DataFrameFormatter directly instead of calling to_html. The second requires additional tests and a clean implementation of the application of display options. |
I personally think this functionality might be useful for people that want to reuse our html machinery for displaying their object. But they could maybe also use a HTMLFormatter directly?
That's true for other options as well, no? (such as max_rows/max_cols) |
or just use the internal
Lines 648 to 654 in dcba7a5
pandas/pandas/io/formats/format.py Lines 901 to 908 in 2115bf3
#25977 does the same for So this can still being addressed without deprecating the notebook argument.
If you are against deprecating the notebook parameter and the discussion continues beyond the 0.25 release, i guess it won't happen. I opened this issue before the 0.24 release, but didn't get much of a response. IMO it's unnecessary, but not a big deal if we don't. I guess the only way to know if users rely on it is with a Deprecation Warning because I don't know and can't argue that point, so feel free to close this if you disagree. |
should to_html(notebook=True) be part of the public facing API or called just from repr_html()?
The text was updated successfully, but these errors were encountered: