-
Notifications
You must be signed in to change notification settings - Fork 121
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
Add Series.length/1
and Series.member?/2
#746
Add Series.length/1
and Series.member?/2
#746
Conversation
It all looks good to me, awesome job. We just need to tackle the issue with Also, we should probably make it so |
@josevalim I figured what was the problem with the datetimes not working! It was indeed a precision issue. By default, datetimes are mapped with precision I figured out a way to solve this by introducing a This worked wonders, I can even mix-and-match duration precisions, and as long as the absolute values are the same it just works (I've even updated the duration test to showcase that). The only caveat is that for this to work nicely for both eager and lazy cases, I started passing the data type information from Elixir to Rust (not really necessary in the eager case, but I thought it would be worth it to keep things consistent). |
This is awesome! Yeah... re: naming I do think there's a lot of potential to get confused with |
@cigrainger what if we call it |
Oh I like |
Aye, pushing a commit with the rename now! 😄 |
💚 💙 💜 💛 ❤️ |
It's me again! 💜
This PR is adding
Series.length/1
(to calculate the length of list elements) andSeries.member?/2
(to check membership in list elements). There are a couple of things to consider:join/2
), but I also thought of something likelist_lenghts/1
andlist_member?/2
. Let me know if you have any thoughts.join/2
was not being implemented forLazySeries
, so I added a test for it inDataFrame.mutate/2
and implemented it as well.Literal
trait. This felt cleaner/easier to re-use, but I'm more than happy to undo it if you prefer the original way.member?/2
, I followed the Python approach (wrap the series into a frame and re-use the lazy implementation). Let me know if you have any thoughts on this.member?/2
work with all our allowed Elixir types, I introduced anExValidValue
enum in the Rust code, which essentially dynamically decodes the Erlang terms into a single type, allowing us to have a single function definition in the Rust code. I think this could be re-used for functions likefill_missing/2
that currently use a double-dispatch approach.member?/2
is not working properly for:datetime
. It doesn't error out, but it returns false when it shouldn't (I've left a skipped test with a comment to demonstrate this). My gut feeling is that it is a precision issue, but I ran out of time to continue investigating tonight. Please let me know if you have any ideas 😅At the same time that it feels like this PR is doing too much, the changes do seem connected, so I've decided to keep it as is instead of splitting it preemptively. Please let me know if you want me to split it up.