Skip to content

[FEA] Refactor Column/NamedColumn split in cudf-polars #16272

@wence-

Description

@wence-

Currently NamedColumn inherits from Column, however, because the constructor of the former takes an additional (required) argument, parent class factory methods that return Self cannot be used for the child class.

This is painful because it means that we must replicate the code: one can't even do super().bla because if that constructs a Self it will have a name missing.

Really, named columns only appears when constructing dataframes: when evaluating expressions, the column can safely drop the name.

In the expression evaluator, the only place a namedcolumn appears is when evaluating a Col expression (which pulls a column out of a dataframe). But at that point, we could drop the name.

This suggests that we shouldn't have that a NamedColumn is-a Column, but rather a NamedColumn has-a Column (and a name).

Metadata

Metadata

Assignees

Labels

0 - BacklogIn queue waiting for assignmentcudf-polarsIssues specific to cudf-polarsfeature requestNew feature or request

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions