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

.hash() return Int64 instead of UInt64 #16424

Closed
Mintactus opened this issue May 23, 2024 · 2 comments
Closed

.hash() return Int64 instead of UInt64 #16424

Mintactus opened this issue May 23, 2024 · 2 comments
Labels
enhancement New feature or an improvement of an existing feature

Comments

@Mintactus
Copy link

Description

Some engine like Neo4j GDS requires Int64 for their IDs, UInt64 make it crash, I think UInt64 should stay the default return behavior but having an optional parameter to decide the format for the hash() output would make it more flexible for different engines having different IDs data types.

@Mintactus Mintactus added the enhancement New feature or an improvement of an existing feature label May 23, 2024
@nameexhaustion
Copy link
Collaborator

You can use Expr.reinterpret to cheaply turn it into Int64

>>> pl.Series([1], dtype=pl.UInt64)
shape: (1,)
Series: '' [u64]
[
	1
]
>>> pl.Series([1], dtype=pl.UInt64).reinterpret()
shape: (1,)
Series: '' [i64]
[
	1
]

@ritchie46
Copy link
Member

@nameexhaustion examples seems like a solid solution for this. Will close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature
Projects
None yet
Development

No branches or pull requests

3 participants