holoviz / panel

Panel: The powerful data exploration & web app framework for Python
https://panel.holoviz.org
BSD 3-Clause "New" or "Revised" License
4.81k stars 520 forks source link

Deprecate panel.widgets.DataFrame proposal #7473

Open thuydotm opened 2 weeks ago

thuydotm commented 2 weeks ago

https://panel.holoviz.org/reference/widgets/DataFrame.html

Feature Overview The DataFrame widget allows displaying and editing a pandas DataFrame.

Deprecation Proposal I propose deprecating this feature in Panel. DataFrame docs also stated that the widget will be replaced with the Tabulator widget. So this may be a good time to actually do it.

Impact Assessment

This means people still look for and use DataFrame but they are getting more used to Tabulator. DataFrame is a very common name/term though.

Effort Involved Tabulator is to replace DataFrame so it supports all features that DataFrame supports, and also new features have been written to Tabulator. We even specified in the docs this deprecation so I'd say this is ready to go.

The primary remaining tasks include:

ahuang11 commented 2 weeks ago

I think this is a good idea; I wonder if there's a way to include a lightweight version of tabulator, ref https://github.com/holoviz/panel/issues/5131

Also, I think the title might be misleading unless I understand incorrectly; it should be Deprecate panel.pane.DataFrame proposal I presume?

hoxbro commented 2 weeks ago

I may be missing something, but will pn.widgets.DataFrame be changed to use the Tabulator widget? Or are we "just" removing the DataFrame widget itself?

Couldn't the goatcounter numbers also mean that Tabulator is not as intuitive as DataFrame or more complex, which means people need to look up the reference of Tabulator more?

thuydotm commented 1 week ago

@hoxbro Deprecation to me is to entirely remove a feature so there will no longer have DataFrame widget in Panel. I don't think it makes sense to make change to pn.widgets.DataFrame to use the Tabulator widget, there'll be 2 widgets with different names that do exactly the same thing. DataFrame is an intuitive name but Tabulator is not just a data frame. We do more than showing and editing a data frame with it. And the widget is built on the Tabulator library so it'll be more consistent to respect the original name.

philippjfr commented 1 week ago

Also, I think the title might be misleading unless I understand incorrectly; it should be Deprecate panel.pane.DataFrame proposal I presume?

No, pn.widgets.DataFrame is correct.

Couldn't the goatcounter numbers also mean that Tabulator is not as intuitive as DataFrame or more complex, which means people need to look up the reference of Tabulator more?

I don't buy this, I think it's 99% down to popularity not complexity.

Overall I'm fine with sunsetting pn.widgets.DataFrame entirely, especially as we work towards supporting more datatypes. If we want to find a more generic name for Tabulator I'd suggest aliasing it to Table or DataTable, update all the docs and eventually remove the Tabulator naming, but that's a different topic for a different day.

philippjfr commented 1 week ago

The real benefit of dropping DataFrame would be to stop loading the bokeh-tables.js bundle, which adds 300 KB to all our apps. That would require some re-architecting though because Tabulator reuses some of the formatters defined in that bundle.

hoxbro commented 1 week ago

I don't buy this, I think it's 99% down to popularity not complexity.

I also think it is mostly do to popularity. Though, I do think the many features of the Tabulator makes it more likely candidate to look up and revisit the site. I know from my self that I use that page the most.

No, pn.widgets.DataFrame is correct.

Earlier the title was Tabulator and not DataFrame, which was what Andrew refenced to.

philippjfr commented 1 week ago

Though, I do think the many features of the Tabulator makes it more likely candidate to look up and revisit the site. I know from my self that I use that page the most.

Definitely true! The SlickGrid based DataFrame is just so ugly and worse in every respect that I can't imagine anyone wanting to use it.

Earlier the title was Tabulator and not DataFrame, which was what Andrew refenced to.

Ah, thanks, just wanted to be clear that we're talking about the widget not the pane, as was referenced by @ahuang11's comment.

ahuang11 commented 1 week ago

Oh wow, I totally forgot there was pn.widgets.DataFrame. Totally in favor of deprecating it completely.

maximlt commented 1 week ago

@thuydotm does pn.widgets.DataFrame have features that pn.widgets.Tabulator doesn't have?


I like that we look at some stats! :) Two other places interesting to look into would be Github and HoloViz Discourse.


Overall I'm fine with sunsetting pn.widgets.DataFrame entirely, especially as we work towards supporting more datatypes.

Does that include objects that are not called or cannot be called DataFrame? If not, I'm wondering if it wouldn't be possible to keep pn.widgets.DataFrame as a name, because it's a pretty good name after all! Since pn.widgets.DataFrame has an API that is mostly a subset of pn.widgets.Tabulator, my guess is that most user code would work fine if we'd just instantiate a Tabulator widget instead of a DataFrame with the kwargs they pass. Deprecating DataFrame would start with a warning and would offer users to opt-in the Tabulator implementation with something like pn.widgets.DataFrame(..., impl='tabulator').

If we want to find a more generic name for Tabulator I'd suggest aliasing it to Table or DataTable, update all the docs and eventually remove the Tabulator naming, but that's a different topic for a different day.

I'm not entirely sure about my little plan above but I am 100% sure renaming things is a pain so we have to think through all that carefully, specially if as Philipp hinted there's a later phase where we migrate users towards a more generic name (we try indeed to avoid naming things after their implementation).

The current scheme is DataFrame -> Tabulator -> Table/DataTable but maybe it could "just" be Tabulator -> DataFrame?