-
Notifications
You must be signed in to change notification settings - Fork 121
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
patch: stableify concat
function
#869
Conversation
concat
function
I don't get how locally it passes. I am getting this some many times π€ gotta be some config out of sync, but I am not sure what needs change |
π€ how annoying...nothing worse than a ci failure you can't reproduce...will take a look |
Thanks Marco! I was actually in a bit of a rush and can't put more effort before tomorrow. def concat(
+ items: Iterable[NwDataFrame[Any] | NwLazyFrame[Any]],
- items: Iterable[DataFrame[Any] | LazyFrame[Any]],
*,
how: Literal["horizontal", "vertical"] = "vertical",
) -> DataFrame[Any] | LazyFrame[Any]: since those stable dataframes are passed in. However then the "inner" Sorry for having to leave this hanging :( |
@@ -24,7 +24,7 @@ def test_validate_laziness() -> None: | |||
NotImplementedError, | |||
match=("The items to concatenate should either all be eager, or all lazy"), | |||
): | |||
nw.concat([nw.from_native(df, eager_only=True), nw.from_native(df).lazy()]) | |||
nw.concat([nw.from_native(df, eager_only=True), nw.from_native(df).lazy()]) # type: ignore[list-item] |
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 am arguing that this is correct for mypy to complain, as it is supposed to raise an error and that's what we are checking
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.
yup, and this is quite satisfying π
df_left = nw.from_native(constructor(data)).lazy() | ||
|
||
data_right = {"c": [6, 12, -1], "d": [0, -4, 2]} | ||
df_right = nw.from_native(constructor(data_right)) | ||
df_right = nw.from_native(constructor(data_right)).lazy() |
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.
Solution was to cast both to lazy so that mypy knows that it's not either eager or lazy.
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.
ah I remember noticing this some time ago, then forgot about it...
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 for doing this @FBruzzesi !
What type of PR is this? (check all applicable)
Related issues
See comment
Checklist
If you have comments or can explain your changes, please do so below.