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: add year, month, day, hour, minute, second, millisecond, micros… #666

Merged

Conversation

aidoskanapyanov
Copy link
Contributor

…econd, nanosecond, ordinal_day for dask

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.

Added some of the dt methods, mostly the trivial ones. Looking into how to implement total_* methods.

@github-actions github-actions bot added the enhancement New feature or request label Jul 29, 2024
@aidoskanapyanov
Copy link
Contributor Author

Pull request number tho :P

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

happy to take this - looks right, and if there's any issues, they should come up when we merge this with the main tests

@MarcoGorelli MarcoGorelli merged commit f10443f into narwhals-dev:main Jul 29, 2024
20 checks passed
Comment on lines +310 to +314
def nanosecond(self) -> DaskExpr:
return self._expr._from_call(
lambda _input: _input.dt.microsecond * 1000,
"nanosecond",
)
Copy link
Member

Choose a reason for hiding this comment

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

in fact, this one might not be correct, looking at how we do it in pandas_like, it should be _input.dt.microsecond * 1000 + _input.dt.nanosecond?

@aidoskanapyanov fancy fixing this in a follow-up pr?

@aidoskanapyanov aidoskanapyanov deleted the feat_add_some_dt_methods_dask branch August 23, 2024 13:00
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.

2 participants