Skip to content

Commit

Permalink
fixed response type
Browse files Browse the repository at this point in the history
  • Loading branch information
singhpranjali committed Aug 25, 2022
1 parent 32e2064 commit 304622b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions marketplace/app/v0/object_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand All @@ -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(
Expand Down Expand Up @@ -107,15 +106,15 @@ 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})
return self._client.post(
self._proxy_path("createDatasetMetadata"),
params=params,
headers=_encode_metadata(metadata),
).text
).json()

@check_capability_availability
def get_dataset(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 304622b

Please sign in to comment.