Description
Looking through the test suite, four tests give this warning:
tests/unit/test_zarrio.py::BaseTestExportZarrToZarr::test_external_link_group
tests/unit/test_zarrio.py::TestExportZarrToZarrDefaultStore::test_external_link_group
tests/unit/test_zarrio.py::TestExportZarrToZarrDirectoryStore::test_external_link_group
tests/unit/test_zarrio.py::TestExportZarrToZarrNestedDirectoryStore::test_external_link_group
/home/runner/work/hdmf-zarr/hdmf-zarr/.tox/py313/lib/python3.13/site-packages/hdmf_zarr/backend.py:811: UserWarning: Could not determine source_object_id for builder with path: /buckets/bucket1/foo_holder/foo1
warnings.warn(warn_msg)
From this line:
hdmf-zarr/src/hdmf_zarr/backend.py
Lines 799 to 811 in 3d08b60
The tests involve a File 2 that has a link to a Foo object in File 1. Then File 2 is exported to File 3. The Foo object in File 1 has a builder but that builder has no parent, because File 1 was not built; just Foo in File 1 was built. As a result, the warning is raised. The Foo builder has a source
and the method has a rel_link_source
. So the source
for the created ZarrReference
is correct, but the source_object_id
is None. Is the object ID of the source file (the root of File 1) necessary for creating a ZarrReference
? Should it be necessary to build the root of File 1 (which means all of File 1 gets built) in order to write a link to an object in File 1?
Of all the uses of export, the above use case is probably quite common. It is confusing and a bit alarming to have this warning appear on export.