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

Extend DataFrame parameter support to other libraries #975

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Nov 8, 2024

As we begin to broaden support for different DataFrame libraries in our ecosystem we need to start at the bottom and work our way up. This PR makes it possible for param.DataFrame to be extended with support for other DataFrame libraries and adds initial support for accepting polars DataFrame and LazyFrame objects. For now we maintain backwards compatibility here and require the user to explicitly define which libraries they want to support by providing a libraries argument.

Copy link

codecov bot commented Nov 8, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 86.38%. Comparing base (31f5717) to head (80752ac).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
param/parameters.py 75.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #975      +/-   ##
==========================================
- Coverage   86.70%   86.38%   -0.32%     
==========================================
  Files          10       10              
  Lines        5151     5201      +50     
==========================================
+ Hits         4466     4493      +27     
- Misses        685      708      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

param/parameters.py Outdated Show resolved Hide resolved
@philippjfr
Copy link
Member Author

@hoxbro @MarcSkovMadsen would love your thoughts. I'd like to think about Narwhals support but am wondering if that may be better implemented as a new parameter type.

Co-authored-by: Simon Høxbro Hansen <simon.hansen@me.com>
Co-authored-by: Simon Høxbro Hansen <simon.hansen@me.com>
@MarcSkovMadsen
Copy link
Collaborator

My POC for how this should be done from param over panel to bokeh is in https://github.com/panel-extensions/panel-graphic-walker/blob/89d6bac66d119d6ad1f75dfe27ec984d18d895ed/src/panel_gwalker/_tabular_data.py#L1

My broader vision for tabular support is in narwhals-dev/narwhals#1289 (comment).

My recommendation would by to first implement this e2e in panel-graphic-walker. That is a place where its really easy to get this working and experimenting e2e. Its also a practical example that will help us have a specific discussion solving real problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants