-
Notifications
You must be signed in to change notification settings - Fork 25
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
[r/python] R and Python create groups with incompatible SOMA metadata #2698
Labels
Comments
@nguyenv @eddelbuettel is this complete now that #2819 is merged? |
@johnkerl would also like to confirm we have a unit test that would catch this... |
@bkmartinjr I'll add a cross-language test here https://github.com/single-cell-data/TileDB-SOMA/tree/1.13.0/apis/system/tests |
johnkerl
changed the title
R and Python create groups with incompatible SOMA metadata
[r/python] R and Python create groups with incompatible SOMA metadata
Aug 15, 2024
mojaveazure
added a commit
that referenced
this issue
Dec 18, 2024
String group-level metadata was previously encoded using `TILEDB_CHAR` or `TILEDB_STRING_ASCII`; however, this resulting in the metadata being read in as `bytes` in the Python API instead of as `str`. The Python API already [encodes all strings (`str`) as `TILEDB_STRING_UTF8`](https://github.com/single-cell-data/TileDB-SOMA/blob/884342a1ceb994d677c52c74ba2d789fc4e208d4/apis/python/src/tiledbsoma/common.cc#L211-L223) so this PR brings the R API in-line with the Python API [SC-61001](https://app.shortcut.com/tiledb-inc/story/61001) resolves #2698
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Objects created by R or Python bindings should have identical metadata, but currently the R and Python packages tag SOMA objects with different and incompatible metadata tags for
dataset_type
,soma_encoding_version
andsoma_object_type
."dataset_type": "soma"
)"dataset_type": b"soma"
)Using TileDB-Py to inspect two arrays.
When array created by Python (array info):
When array created by R (array info):
I also checked directly reading from S3, i.e., not using the
tiledb://
URI, and the result is the same.Where a "string" or "byte array" is right, I think it is reasonably clear that there is a bug here - the mandatory metadata tags should be identical no matter which ingestion system is used, and which package is used to read it back.
Side note: the current Python package seems to have a work-around for this, as it detects byte array metadata and converts it to utf-8. This is nice, but doesn't seem like the right answer, as it requires any other user of that metadata (e.g., end-user code) to do the same encoding/decoding step for any/all metadata values.
In my opinion, we should be using utf-8 everywhere (and document that in the SOMA spec), but at a minimum, we should have common behavior across all reader/writer code.
The text was updated successfully, but these errors were encountered: