mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-15 20:57:56 +08:00
Previously if the user remove all annotations, the code would still generate a tiledb uri in the write_labels call, and add that to the database. A tiledb array would not be written in this case. When the read_labels was then called, it would find the entry in the database, attempt to open the tiledb array, then fail. The patch here will set the tiledb_uri to the empty string if all categories are removed. When read_labels is called, it will see the empty uri and return None. Furthermore, if the database does have a tiledb_uri that does not exist, or cannot be read, then the code will now log a warning, and return None (instead of throwing an exception, which results in a server error). #1932