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: Preserve null values in old Polars versions for ewm_mean #1574

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

DeaMariaLeon
Copy link
Member

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

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 @DeaMariaLeon ! just got a minor comment, then good to go πŸš€

)
if self._backend_version < (1,): # pragma: no cover
pl = get_polars()
Copy link
Member

Choose a reason for hiding this comment

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

we should be ok to just import polars here in _polars

if self._backend_version < (1,): # pragma: no cover
pl = get_polars()
return self._from_native_expr(
pl.when(expr.is_null()).then(None).otherwise(native_expr).name.keep()
Copy link
Member

Choose a reason for hiding this comment

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

does

pl.when(~expr.is_null()).then(native_expr).otherwise(None)

work? then it would mirror what you did for series

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants