Skip to content

feat: Support Narwhals #6567

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

Draft
wants to merge 72 commits into
base: main
Choose a base branch
from
Draft

feat: Support Narwhals #6567

wants to merge 72 commits into from

Conversation

hoxbro
Copy link
Member

@hoxbro hoxbro commented Apr 24, 2025

Still very much draft... A lot of the logic is currently copied/pasted from the PandasInterface.

import polars as pl
import pyarrow as pa

import holoviews as hv

hv.extension("bokeh", "matplotlib", "plotly")

data = {"a": [1, 2, 3], "b": [4, 5, 6]}
df_pandas = pd.DataFrame(data)
df_polars = pl.DataFrame(data)
table_pa = pa.table(data)

layout = hv.Curve(df_polars) + hv.Scatter(table_pa)
layout

image

Copy link

codecov bot commented Apr 28, 2025

Codecov Report

Attention: Patch coverage is 85.65022% with 96 lines in your changes missing coverage. Please review.

Project coverage is 88.78%. Comparing base (de3f00e) to head (f7781cc).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
holoviews/core/data/narwhals.py 83.55% 62 Missing ⚠️
...oloviews/tests/core/data/test_narwhalsinterface.py 88.81% 18 Missing ⚠️
holoviews/core/util/__init__.py 60.86% 9 Missing ⚠️
holoviews/operation/element.py 28.57% 5 Missing ⚠️
holoviews/util/transform.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6567      +/-   ##
==========================================
- Coverage   88.82%   88.78%   -0.04%     
==========================================
  Files         326      328       +2     
  Lines       69449    70060     +611     
==========================================
+ Hits        61685    62200     +515     
- Misses       7764     7860      +96     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -645,7 +645,7 @@ def select(self, selection_expr=None, selection_specs=None, **selection):
return self

# Handle selection dim expression
if selection_expr is not None:
if selection_expr is not None and selection_expr.ops:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would also make something like hv.Dataset(df_pandas).select(selection_expr=hv.dim('a')) fail

@hoxbro hoxbro added this to the 1.22.0 milestone Jun 16, 2025
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.

1 participant