Skip to content

chore: Spec CompliantDataFrame #2223

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

Merged
merged 14 commits into from
Mar 16, 2025
Merged

chore: Spec CompliantDataFrame #2223

merged 14 commits into from
Mar 16, 2025

Conversation

dangotbanned
Copy link
Member

@dangotbanned dangotbanned commented Mar 16, 2025

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

  • Decide on PolarsDataFrame.__getattr__ annotations
  • Implement CompliantDataFrame.aggregate (4dc0514)
  • Fix (FBT001) issues (70cc069)
  • Using CompliantExpr in CompliantDataFrame

- Variance of `CompliantSeriesT_co` changed due to how it is used
- Made a lot of the types more generic
  - They can be refined by the implementations
  - Some will handle coverting to narrower types, where that backend demands it
- **Main missing part** is `CompliantExpr`
  - Need to spec `CompliantSeries` first
  - Otherwise, introduces lots of errors for `Polars*`
- Technically works, but I'd like to avoid the `Any`
- Maybe adding a generic callable alias, that gets subscribed w/ `Self`?
- Have a feeling this was used more in the past
- E.g. when `select` accepted `*args, **kwds`
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.

thanks @dangotbanned !

just got a comment on the aggregate comment

- Resolves #2223 (comment)
- Will help with `EagerDataFrame` as well
- `filter` accepts a `list` in some cases
- `group_by` will need `CompliantGroupBy`
  - See also #2184 (comment)
- Now we don't accept any arbitrary expression
  - It must derive the current type
- Simplifies the typing
  - Really wasn't happy with what I had previously
  - Glad that is gone now
- Added a doc, since the single output part is really the most important
@dangotbanned dangotbanned marked this pull request as ready for review March 16, 2025 19:06
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 @dangotbanned! just one small question

really appreciate you doing this πŸ™

@dangotbanned
Copy link
Member Author

awesome

thanks @dangotbanned! just one small question

really appreciate you doing this πŸ™

Thanks @MarcoGorelli!

What's your question?

@MarcoGorelli
Copy link
Member

Sorry it got lost πŸ˜ƒ just left it as a comment

@dangotbanned dangotbanned merged commit 85e557e into main Mar 16, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants