diff --git a/client/qiskit_serverless/core/clients/serverless_client.py b/client/qiskit_serverless/core/clients/serverless_client.py index 7bc4f2468..b34a9155e 100644 --- a/client/qiskit_serverless/core/clients/serverless_client.py +++ b/client/qiskit_serverless/core/clients/serverless_client.py @@ -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) diff --git a/client/qiskit_serverless/core/files.py b/client/qiskit_serverless/core/files.py index 682e70032..f4770d94f 100644 --- a/client/qiskit_serverless/core/files.py +++ b/client/qiskit_serverless/core/files.py @@ -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( @@ -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/"), @@ -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( @@ -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"),