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

[python] Group and array-level meta data written as bytes should be preserved as bytes #3502

Open
mojaveazure opened this issue Dec 20, 2024 · 0 comments

Comments

@mojaveazure
Copy link
Member

When writing group- or array-level meta data, bytes are cast to TILEDB_STRING_UTF8 instead of TILEDB_STRING_ASCII, resulting in the meta data being read back as str instead of bytes

>>> # Write metadata as both `str` and `bytes`
>>> grp = tiledbsoma.Collection.create("temp")
>>> grp.metadata["str"] = "test_string"
>>> grp.metadata["bytes"] = b"test_bytes"
>>> grp.close()

>>> # Read it back
>>> grp = tiledbsoma.Collection.open("temp")
>>> {x: type(grp.metadata[x]) for x in ("str", "bytes")}
{'str': <class 'str'>, 'bytes': <class 'str'>}
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