diff --git a/pinecone/db_data/index.py b/pinecone/db_data/index.py index fdee9092..0aff31f4 100644 --- a/pinecone/db_data/index.py +++ b/pinecone/db_data/index.py @@ -66,7 +66,8 @@ def parse_query_response(response: QueryResponse): """:meta private:""" - response._data_store.pop("results", None) + if "results" in response._data_store: + del response._data_store["results"] return response @@ -643,7 +644,7 @@ def delete_namespace(self, namespace: str, **kwargs) -> Dict[str, Any]: @validate_and_convert_errors @require_kwargs def list_namespaces( - self, limit: Optional[int] = None, **kwargs + self, limit: Optional[int] = None, **kwargs ) -> Iterator[ListNamespacesResponse]: return self.namespace.list(limit=limit, **kwargs) @@ -652,4 +653,6 @@ def list_namespaces( def list_namespaces_paginated( self, limit: Optional[int] = None, pagination_token: Optional[str] = None, **kwargs ) -> ListNamespacesResponse: - return self.namespace.list_paginated(limit=limit, pagination_token=pagination_token, **kwargs) \ No newline at end of file + return self.namespace.list_paginated( + limit=limit, pagination_token=pagination_token, **kwargs + )