Skip to content

Conversation

@FBruzzesi
Copy link
Member

What type of PR is this? (check all applicable)

  • πŸ’Ύ Refactor
  • ✨ Feature
  • πŸ› Bug Fix
  • πŸ”§ Optimization
  • πŸ“ Documentation
  • βœ… Test
  • 🐳 Other

Related issues

Checklist

  • Code follows style guide (ruff)
  • Tests added
  • Documented the changes

If you have comments or can explain your changes, please do so below

@FBruzzesi FBruzzesi changed the title Feat/dask group by var std fix: dask group by with kwargs Dec 29, 2024
def var(
ddof: int = 1,
) -> Callable[
[pd.core.groupby.generic.SeriesGroupBy], pd.core.groupby.generic.SeriesGroupBy
Copy link
Member Author

Choose a reason for hiding this comment

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

I need to double check the return type


import dask_expr as dx

return partial(dx._groupby.GroupBy.var, ddof=ddof)
Copy link
Member Author

Choose a reason for hiding this comment

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

The minimum version we support for dask is "dask[dataframe]==2024.7", which installs dask-expr==1.1.8, and dx._groupby.GroupBy is already available.

Copy link
Member

Choose a reason for hiding this comment

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

@phofl is there a public variant of this?

@FBruzzesi FBruzzesi added fix high priority Your PR will be reviewed very quickly if you address this labels Jan 3, 2025
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

awesome, thanks a lot @FBruzzesi !

if we can use a public variant for dask expr's groupby, then that'd probably be better, else i think this is ok (we test against their nightlies anyway)

@FBruzzesi
Copy link
Member Author

FBruzzesi commented Jan 4, 2025

Thanks for reviewing @MarcoGorelli πŸ‘Œ

if we can use a public variant for dask expr's groupby, then that'd probably be better, else i think this is ok (we test against their nightlies anyway)

It's definitly not exposed in dask-expr.

As mentioned in the discourse thread we could use dd.groupby.DataFrameGroupBy until the current dask version. But we would encounter the same issue from this month release onwards.

@MarcoGorelli
Copy link
Member

Just caught up with Patrick from Dask, and he's said that they plan to merge dask-expr into dask and then they'll expose some public apis, and that we can merge as-is for now

@MarcoGorelli MarcoGorelli merged commit 223cb2e into main Jan 4, 2025
24 checks passed
@MarcoGorelli MarcoGorelli deleted the feat/dask-group-by-var-std branch January 4, 2025 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix high priority Your PR will be reviewed very quickly if you address this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: group_by context ignores expr arguments

3 participants