From 50f11639347e102cc552e9f11e3c37d2eacbfb1a Mon Sep 17 00:00:00 2001 From: singhpranjali Date: Thu, 25 Aug 2022 17:17:57 +0200 Subject: [PATCH] fixed response type --- marketplace/app/v0/object_storage.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/marketplace/app/v0/object_storage.py b/marketplace/app/v0/object_storage.py index e86c4ec..7973e7c 100644 --- a/marketplace/app/v0/object_storage.py +++ b/marketplace/app/v0/object_storage.py @@ -44,12 +44,12 @@ def create_or_update_collection( self, metadata: dict = None, collection_name: object_storage.CollectionName = None, - ) -> str: + ): return self._client.put( self._proxy_path("createOrUpdateCollection"), params={"collection_name": collection_name} if collection_name else {}, headers=_encode_metadata(metadata), - ).text + ).json() @check_capability_availability def delete_collection(self, collection_name: object_storage.CollectionName): @@ -58,7 +58,6 @@ def delete_collection(self, collection_name: object_storage.CollectionName): params={"collection_name": collection_name}, ) - # NOTE: change to GET for the meeting if proxy doesn't support HEAD requests @check_capability_availability def get_collection_metadata( self, collection_name: object_storage.CollectionName @@ -74,12 +73,12 @@ def create_collection( self, collection_name: object_storage.CollectionName = None, metadata: dict = None, - ) -> str: + ): return self._client.put( self._proxy_path("createCollection"), params={"collection_name": collection_name} if collection_name else {}, headers=_encode_metadata(metadata), - ).text + ).json() @check_capability_availability def create_dataset( @@ -107,7 +106,7 @@ def create_dataset_metadata( collection_name: object_storage.CollectionName, dataset_name: object_storage.DatasetName = None, metadata: dict = None, - ) -> str: + ): params = {"collection_name": collection_name} if dataset_name: params.update({"dataset_name": dataset_name}) @@ -115,7 +114,7 @@ def create_dataset_metadata( self._proxy_path("createDatasetMetadata"), params=params, headers=_encode_metadata(metadata), - ).text + ).json() @check_capability_availability def get_dataset( @@ -153,12 +152,12 @@ def create_or_replace_dataset_metadata( collection_name: object_storage.CollectionName, dataset_name: object_storage.DatasetName, metadata: dict = None, - ) -> str: + ): return self._client.put( self._proxy_path("createOrReplaceDatasetMetadata"), params={"collection_name": collection_name, "dataset_name": dataset_name}, headers=_encode_metadata(metadata), - ).text + ).json() @check_capability_availability def delete_dataset(