Skip to content

ENH Supports DataFrame API for polars in ColumnTransformer #26669

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

Closed

Conversation

thomasjpfan
Copy link
Member

Reference Issues/PRs

Towards #25896
Supersedes #26115

What does this implement/fix? Explain your changes.

As a first step, this PR adds polars support to ColumnTransformer using the DataFrame API Spec. The ColumnTransformer will slice the DataFrame on the column axis and pass it as Polars DataFrames to the inner transformers.

Any other comments?

This PR only adds polars input to ColumnTransformer. Polars output is not in scope for this PR.

@github-actions
Copy link

github-actions bot commented Jun 22, 2023

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: b2f2a23

@@ -620,7 +620,7 @@ def _validate_output(self, result):
name for name, _, _, _ in self._iter(fitted=True, replace_strings=True)
]
for Xs, name in zip(result, names):
if not getattr(Xs, "ndim", 0) == 2:
if not getattr(Xs, "ndim", 0) == 2 and not hasattr(Xs, "__dataframe__"):
Copy link
Member

Choose a reason for hiding this comment

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

can we PLEASE move these ducktypes to a utility?

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

Successfully merging this pull request may close these issues.

2 participants