Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Tansito committed Dec 26, 2024
1 parent bcf947c commit d426ec4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 23 deletions.
14 changes: 5 additions & 9 deletions client/qiskit_serverless/core/clients/serverless_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,19 +426,15 @@ def provider_file_download(
file, download_location, function, target_name
)

def file_delete(
self, file: str, function: QiskitFunction, provider: Optional[str] = None
):
def file_delete(self, file: str, function: QiskitFunction):
"""Deletes file uploaded or produced by the programs,"""
return self._files_client.delete(file, function, provider)
return self._files_client.delete(file, function)

def provider_file_delete(self, file: str, function: QiskitFunction, provider: str):
def provider_file_delete(self, file: str, function: QiskitFunction):
"""Deletes file uploaded or produced by the programs,"""
return self._files_client.provider_delete(file, function, provider)
return self._files_client.provider_delete(file, function)

def file_upload(
self, file: str, function: QiskitFunction
):
def file_upload(self, file: str, function: QiskitFunction):
"""Upload file."""
return self._files_client.upload(file, function)

Expand Down
20 changes: 6 additions & 14 deletions client/qiskit_serverless/core/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ def provider_download(
)

@_trace
def upload(
self, file: str, function: QiskitFunction
) -> Optional[str]:
def upload(self, file: str, function: QiskitFunction) -> Optional[str]:
"""Uploads file."""
with open(file, "rb") as f:
with requests.post(
Expand All @@ -151,13 +149,11 @@ def upload(
return "Can not open file"

@_trace
def provider_upload(
self, file: str, function: QiskitFunction
) -> Optional[str]:
def provider_upload(self, file: str, function: QiskitFunction) -> Optional[str]:
"""Uploads file to provider/function file storage."""
if not function.provider:
raise QiskitServerlessException("`function` doesn't have a provider.")

"""Uploads file to provider/function file storage."""
with open(file, "rb") as f:
with requests.post(
os.path.join(self._files_url, "upload/"),
Expand Down Expand Up @@ -202,9 +198,7 @@ def provider_list(self, function: QiskitFunction) -> List[str]:
return response_data.get("results", [])

@_trace
def delete(
self, file: str, function: QiskitFunction
) -> Optional[str]:
def delete(self, file: str, function: QiskitFunction) -> Optional[str]:
"""Deletes file uploaded or produced by the programs,"""
response_data = safe_json_request_as_dict(
request=lambda: requests.delete(
Expand All @@ -224,13 +218,11 @@ def delete(
return response_data.get("message", "")

@_trace
def provider_delete(
self, file: str, function: QiskitFunction
) -> Optional[str]:
def provider_delete(self, file: str, function: QiskitFunction) -> Optional[str]:
"""Deletes a file uploaded or produced by the Qiskit Functions"""
if not function.provider:
raise QiskitServerlessException("`function` doesn't have a provider.")

"""Deletes file uploaded or produced by the programs,"""
response_data = safe_json_request_as_dict(
request=lambda: requests.delete(
os.path.join(self._files_url, "provider", "delete"),
Expand Down

0 comments on commit d426ec4

Please sign in to comment.