Skip to content

Commit a6f30a3

Browse files
authored
[BUG]: root collection ID should be null if empty string (#4663)
## Description of changes Some rows in our database have `root_collection_id: ""` instead of having it set to null. We're not sure why this happened, this is a quick patch as a short-term fix while we continue to investigate. ## Test plan _How are these changes tested?_ - [ ] Tests pass locally with `pytest` for python, `yarn test` for js, `cargo test` for rust ## Documentation Changes _Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the [docs section](https://github.com/chroma-core/chroma/tree/main/docs/docs.trychroma.com)?_
1 parent ed23eed commit a6f30a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/pkg/sysdb/metastore/db/dao/collection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (s *collectionDb) DeleteAll() error {
3030
func (s *collectionDb) GetCollectionWithoutMetadata(collectionID *string, databaseName *string, softDeletedFlag *bool) (*dbmodel.Collection, error) {
3131
var collections []*dbmodel.Collection
3232
query := s.db.Table("collections").
33-
Select("collections.id, collections.name, collections.database_id, collections.is_deleted, collections.tenant, collections.version, collections.version_file_name, collections.root_collection_id, NULLIF(collections.lineage_file_name, '') AS lineage_file_name").
33+
Select("collections.id, collections.name, collections.database_id, collections.is_deleted, collections.tenant, collections.version, collections.version_file_name, NULLIF(collections.root_collection_id, '') AS root_collection_id, NULLIF(collections.lineage_file_name, '') AS lineage_file_name").
3434
Joins("INNER JOIN databases ON collections.database_id = databases.id").
3535
Where("collections.id = ?", collectionID)
3636

0 commit comments

Comments
 (0)