-
Notifications
You must be signed in to change notification settings - Fork 932
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
Reorganize cudf_polars
expression code
#17014
Reorganize cudf_polars
expression code
#17014
Conversation
from polars.polars import _expr_nodes as pl_expr | ||
|
||
from cudf_polars.containers import Column, NamedColumn | ||
from cudf_polars.utils import dtypes, sorting | ||
from cudf_polars.containers import Column |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to keep this file at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally a few of these didn't seem to have an obvious home, maybe a misc.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is useful to have everything importable from one place. So yes, I think it makes sense to keep this file.
I think it would be nice if all this file did was to import the expression names into the dsl.expr
namespace.
So moving the remainder makes sense to me.
How about Cast
into unary.py
, Ternary
into ternary.py
and BooleanFunction
into boolean.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @brandon-b-miller! This looks like a good step to me. Some small further suggestions.
from polars.polars import _expr_nodes as pl_expr | ||
|
||
from cudf_polars.containers import Column, NamedColumn | ||
from cudf_polars.utils import dtypes, sorting | ||
from cudf_polars.containers import Column |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is useful to have everything importable from one place. So yes, I think it makes sense to keep this file.
I think it would be nice if all this file did was to import the expression names into the dsl.expr
namespace.
So moving the remainder makes sense to me.
How about Cast
into unary.py
, Ternary
into ternary.py
and BooleanFunction
into boolean.py
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changeset is large, so I assumed that this was a pure reorg with no material changes and reviewed it as such by just skimming what went into each file. Overall this is a definite improvement and I'd be fine merging it as is. Some of the module groupings might get harder to rationalize over time, though, and some of them are already a bit more tenuous than others. That makes me wonder if we should just go with one class per module. We're already most of the way there; a couple of modules have 2-3 classes, but that's about it. WDYT? I'm OK merging this either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we merge this one before #17016?
/merge |
Thanks Brandon! |
This PR seeks to break up
expr.py
into a less unwieldy monolith.