Skip to content

chore: Make Polars(Expr|Series) compliant#2328

Merged
MarcoGorelli merged 7 commits intomainfrom
polars-series-compliant
Apr 4, 2025
Merged

chore: Make Polars(Expr|Series) compliant#2328
MarcoGorelli merged 7 commits intomainfrom
polars-series-compliant

Conversation

@dangotbanned
Copy link
Member

@dangotbanned dangotbanned commented Apr 3, 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

- Related #2325 (comment)
- `PolarsExpr` is the source of the "new" ignore
- Was hidden by using `Incomplete`

```log
"PolarsSeries" is incompatible with protocol "CompliantSeries[Any]"
  "CompliantSeries[NativeSeriesT_co@CompliantSeries]" is not assignable to "PolarsSeries"
  "_to_expr" is an incompatible type
    Type "() -> PolarsExpr" is not assignable to type "() -> CompliantExpr[Any, PolarsSeries]"
 ... (reportInvalidTypeArguments)
 ```
Still not really accurate, but the last point in the note is no longer true
Comment on lines +171 to +173
def over(
self, partition_by: Sequence[str], order_by: Sequence[str] | None
) -> Self: ...
Copy link
Member Author

Choose a reason for hiding this comment

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

Weird that the keys -> partition_by rename didn't show up as an issue elsewhere 🤔

@dangotbanned dangotbanned marked this pull request as ready for review April 3, 2025 14:57
Comment on lines +656 to +664
to_list: Method[list[Any]]
to_pandas: Method[pd.Series[Any]]
unique: Method[Self]
var: Method[float]
zip_with: Method[Self]

@property
def list(self: Self) -> PolarsSeriesListNamespace:
return PolarsSeriesListNamespace(self)
Copy link
Member Author

Choose a reason for hiding this comment

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

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.

nice one, thanks @dangotbanned !

@MarcoGorelli MarcoGorelli merged commit e0f7b18 into main Apr 4, 2025
28 checks passed
@MarcoGorelli MarcoGorelli deleted the polars-series-compliant branch April 4, 2025 09:21
dangotbanned added a commit that referenced this pull request Apr 8, 2025
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