-
Notifications
You must be signed in to change notification settings - Fork 147
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]: hash expr #2398
[FEAT]: hash expr #2398
Conversation
src/daft-dsl/src/functions/hash.rs
Outdated
match inputs { | ||
[input] => input.hash(None).map(|s| s.into_series()), | ||
[input, seed] => { | ||
if seed.len() != 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also be able to use seed if the length is equal to input like in the case x.hash(seed=y.hash())
@@ -249,6 +249,24 @@ def test_repr_functions_sqrt() -> None: | |||
assert repr_out == repr(copied) | |||
|
|||
|
|||
def test_repr_functions_hash() -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also be good to run some of these hash tests that we run on the series on the expression as well!
https://github.com/Eventual-Inc/Daft/blob/main/tests/series/test_hash.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking that too, but didn't see anywhere else the exprs were being tested like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have tests like these here in table
https://github.com/Eventual-Inc/Daft/blob/main/tests/table/utf8/test_ilike.py where we test the expression.
You can create a new file like test_hash.py
and test the hash expression on a table
closes #1905