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]: hash expr #2398

Merged
merged 2 commits into from
Jun 20, 2024
Merged

Conversation

universalmind303
Copy link
Collaborator

closes #1905

@github-actions github-actions bot added the enhancement New feature or request label Jun 18, 2024
match inputs {
[input] => input.hash(None).map(|s| s.into_series()),
[input, seed] => {
if seed.len() != 1 {
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 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:
Copy link
Member

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

Copy link
Collaborator Author

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.

Copy link
Contributor

@colin-ho colin-ho Jun 18, 2024

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

@universalmind303 universalmind303 merged commit a2bb7f8 into Eventual-Inc:main Jun 20, 2024
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
3 participants