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

UUID values get coerced into list of ints if inside a json object #269

Open
creatorrr opened this issue Jun 21, 2024 · 1 comment
Open

Comments

@creatorrr
Copy link
Contributor

This query:

{
  ?[x] <- [[rand_uuid_v4()]]
  :create _t1 { x }
}
{
  ?[m, x] := *_t1{ x }, m = {"x": x}
}

returns:

{"x":[121,28,28,145,81,157,79,140,149,37,235,235,103,33,105,109]}	791c1c91-519d-4f8c-9525-ebeb6721696d

but should return the uuidv4 string instead. Currently I was unable to find a way to output the string :(

@creatorrr
Copy link
Contributor Author

for anyone else who ran into this, current workaround I am using (in python):

from uuid import UUID

uuid_int_list_to_uuid4 = lambda data: UUID(bytes=b"".join([i.to_bytes(1, 'big') for i in data]))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant