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

feat: extend dataframe drop_nulls method #779

Merged
merged 1 commit into from
Aug 12, 2024
Merged

Conversation

FBruzzesi
Copy link
Member

@FBruzzesi FBruzzesi commented Aug 12, 2024 β€’

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.

Add support for subset argument in dataframe drop_nulls method

Sorry, something went wrong.

@github-actions github-actions bot added enhancement New feature or request labels Aug 12, 2024
Comment on lines +294 to +296
subset = [subset] if isinstance(subset, str) else subset
plx = self.__narwhals_namespace__()
return self.filter(~plx.any_horizontal(plx.col(*subset).is_null()))
Copy link
Member Author

Choose a reason for hiding this comment

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

It's a bit of repeated code but avoids having any logic in BaseFrame. There are these situations in which polars works out of the box and for the rest implementing the solution using polars-like methods is just very neat

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 @FBruzzesi !

@MarcoGorelli MarcoGorelli merged commit 54cd277 into main Aug 12, 2024
25 checks passed
@FBruzzesi FBruzzesi deleted the feat/extend-drop-nulls branch August 12, 2024 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants