Skip to content

feat!: remove maintain_order from LazyFrame.unique, as it was never supported#2247

Merged
MarcoGorelli merged 2 commits intonarwhals-dev:mainfrom
MarcoGorelli:no-maintain-order-in-lazy
Mar 19, 2025
Merged

feat!: remove maintain_order from LazyFrame.unique, as it was never supported#2247
MarcoGorelli merged 2 commits intonarwhals-dev:mainfrom
MarcoGorelli:no-maintain-order-in-lazy

Conversation

@MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli commented Mar 19, 2025

If this affects anyone, we could backport maintain_order as a no-op to stable.v1

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

@MarcoGorelli MarcoGorelli marked this pull request as ready for review March 19, 2025 11:33
@MarcoGorelli MarcoGorelli added enhancement New feature or request breaking labels Mar 19, 2025
@MarcoGorelli MarcoGorelli merged commit 19c3e9c into narwhals-dev:main Mar 19, 2025
29 checks passed
dangotbanned added a commit that referenced this pull request Mar 19, 2025
MarcoGorelli pushed a commit that referenced this pull request Mar 19, 2025
* chore(typing): Mostly finish `CompliantLazyFrame`

* fix: add missing `CompliantDataFrame.explode`

* feat(typing): Adds `not_implemented.deprecated`

Only way I've come up with to preserve the deprecation message

* chore(typing): Finish `PolarsLazyFrame`

* chore(typing): Finish `SparkLikeLazyFrame`

* chore(typing): Finish `DaskLazyFrame`

* chore(typing): Finish `DuckDBLazyFrame`

* fix(typing): `PandasLikeDataFrame.explode`

* chore(typing): Mark `.lazy` return as `Incomplete`

I can't work out what is the desired behavior

* chore(typing): Fill `Incomplete` for `*Expr`

* revert: remove `.to_(arrow|pandas)`

#2232 (comment)

* fix(DRAFT): Expose `CompliantLazyFrame.native`

- Will need something similar with `DataFrame`
- Aiming to solve #2239 (comment)

* fix: remove default in `CompliantLazyFrame.lazy`

```py
narwhals/_compliant/dataframe.py:262: error: Definition of "lazy" in base class "CompliantDataFrame" is incompatible with definition in base class "CompliantLazyFrame"  [misc]
    class EagerDataFrame(
    ^
```

* fix(typing): Align `unique` sigantures

3x of these:
```py
error: Signature of "unique" incompatible with supertype "CompliantLazyFrame"  [override]
```

Even though `maintain_order` is unused - `EagerDataFrame` (and subclasses) require the same signature

* fix: coverage for `PolarsLazyFrame.native`

https://github.com/narwhals-dev/narwhals/actions/runs/13929256423/job/38981936344

* fix(typing): Add missing `_change_version` method

> error: Cannot access attribute "_change_version" for class "CompliantLazyFrame[Any, FrameT@_stableify]"

* chore(typing): Mark intended annotation, that isn't valid yet

`mypy` expands to an invalid type
> "CompliantLazyFrame[Any, NativeFrame]" of "Any | CompliantLazyFrame[Any, NativeFrame] | CompliantLazyFrame[Any, DataFrame[Any]] | CompliantLazyFrame[Any, LazyFrame[Any]] | CompliantLazyFrame[Any, DataFrameLike]"

* revert: remove `CompliantLazyFrame.lazy`

#2232 (comment)

* lol `maintain_order` default one side only 😅

Resolves #2232 (comment)

* revert: don't widen `keep` for lazy

* make `keep` a keyword again

conflict from (#2247)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant