Skip to content
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

chore: flatten subset in unique one level up #1671

Merged
merged 2 commits into from
Dec 29, 2024

Conversation

MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli commented Dec 28, 2024

In general, it's probably good if we simplify the implementation of CompliantFrames by doing these kinds of operations at the Narwhals level

If we want to encourage people to extend Narwhals, it'll be easier if they just have to worry about subset: list[str] | None rather than subset: str | list[str] | None

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

  • 💾 Refactor
  • ✨ Feature
  • 🐛 Bug Fix
  • 🔧 Optimization
  • 📝 Documentation
  • ✅ Test
  • 🐳 Other

Related issues

  • Related issue #<issue number>
  • Closes #<issue number>

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 December 28, 2024 19:23
Copy link
Member

@FBruzzesi FBruzzesi left a comment

Choose a reason for hiding this comment

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

I think that's ok and I agree that for someone extending the API this is easier.

The only good use case to keep signature the same is for other methods to (re)use existing Compliant classes methods, yet it's fairly easy to spot what to pass with the fully annotated internals.

Ship it!

CatKittenGIF

P.S. consider adding this gif?! 👀

@MarcoGorelli MarcoGorelli merged commit 188ae97 into narwhals-dev:main Dec 29, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants