diff --git a/chromadb/api/models/CollectionCommon.py b/chromadb/api/models/CollectionCommon.py index 2ed3461db9d..9e373858630 100644 --- a/chromadb/api/models/CollectionCommon.py +++ b/chromadb/api/models/CollectionCommon.py @@ -278,8 +278,8 @@ def _validate_and_prepare_get_request( "You must set a data loader on the collection if loading from URIs." ) - # Prepare - request_include = include + # Copy the list before any in-place modifications. + request_include = list(include) if include else [] # We need to include uris in the result from the API to load datas if "data" in include and "uris" not in include: request_include.append("uris") @@ -343,7 +343,8 @@ def _validate_and_prepare_query_request( request_where_document = filters["where_document"] # We need to manually include uris in the result from the API to load datas - request_include = include + # Copy the list before any in-place modifications. + request_include = list(include) if include else [] if "data" in request_include and "uris" not in request_include: request_include.append("uris")