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

Remove Scalar container type from polars interpreter #15953

Merged
merged 14 commits into from
Jun 11, 2024

Conversation

wence-
Copy link
Contributor

@wence- wence- commented Jun 7, 2024

Description

Now we always return columns and, where usage of a scalar might be
correct (for example broadcasting in binops), we check if the column
is "actually" a scalar and extract it.

This is slightly annoying because we have to introspect things in
various places. But without changing libcudf to treat length-1 columns
as always broadcastable like scalars this is, I think, the best we can
do.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@wence- wence- requested review from a team as code owners June 7, 2024 11:57
@github-actions github-actions bot added Python Affects Python cuDF API. cudf.polars Issues specific to cudf.polars labels Jun 7, 2024
python/cudf_polars/cudf_polars/__init__.py Show resolved Hide resolved
Comment on lines -52 to -54
[tool.setuptools.packages.find]
exclude = ["*tests*"]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was doing the wrong thing, the default find works correctly. With this exclusion, if you did a pip install . then the contents of the build directory would be discovered, producing a nested recursive mess of horror.

python/cudf_polars/cudf_polars/dsl/ir.py Show resolved Hide resolved
python/cudf_polars/cudf_polars/dsl/expr.py Show resolved Hide resolved
python/cudf_polars/cudf_polars/dsl/expr.py Show resolved Hide resolved
python/cudf_polars/cudf_polars/containers/column.py Outdated Show resolved Hide resolved
python/cudf_polars/cudf_polars/containers/column.py Outdated Show resolved Hide resolved
@wence- wence- added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Jun 7, 2024
Copy link
Contributor

@brandon-b-miller brandon-b-miller left a comment

Choose a reason for hiding this comment

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

Couple q's

wence- added 4 commits June 10, 2024 10:58
Now we always return columns and, where usage of a scalar might be
correct (for example broadcasting in binops), we check if the column
is "actually" a scalar and extract it.

This is slightly annoying because we have to introspect things in
various places. But without changing libcudf to treat length-1 columns
as always broadcastable like scalars this is, I think, the best we can
do.
@wence- wence- force-pushed the wence/fea/no-scalar-container branch from 99348d5 to 1f22fdf Compare June 10, 2024 10:58
@wence-
Copy link
Contributor Author

wence- commented Jun 10, 2024

Addressed comments and added test

Copy link
Contributor

@brandon-b-miller brandon-b-miller left a comment

Choose a reason for hiding this comment

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

LGTM, I think you may need a merge of 24.08 to pass CI.

Copy link
Contributor

@vyasr vyasr left a comment

Choose a reason for hiding this comment

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

Some small suggestions for improvement, but nothing blocking. LGTM.

python/cudf_polars/cudf_polars/containers/column.py Outdated Show resolved Hide resolved
python/cudf_polars/cudf_polars/dsl/expr.py Show resolved Hide resolved
python/cudf_polars/cudf_polars/dsl/ir.py Outdated Show resolved Hide resolved
python/cudf_polars/cudf_polars/dsl/ir.py Outdated Show resolved Hide resolved
@wence-
Copy link
Contributor Author

wence- commented Jun 11, 2024

/merge

@rapids-bot rapids-bot bot merged commit 22ac996 into rapidsai:branch-24.08 Jun 11, 2024
72 checks passed
@wence- wence- deleted the wence/fea/no-scalar-container branch June 14, 2024 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cudf.polars Issues specific to cudf.polars improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants