From 60cdb88c61fa2eba9830893df8634e6de3d26ad2 Mon Sep 17 00:00:00 2001 From: David <9059044+Tansito@users.noreply.github.com> Date: Wed, 11 Sep 2024 11:41:41 -0400 Subject: [PATCH] Deprecate get_jobs method --- client/qiskit_serverless/core/function.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/client/qiskit_serverless/core/function.py b/client/qiskit_serverless/core/function.py index 22caa3b45..6ee3cfa90 100644 --- a/client/qiskit_serverless/core/function.py +++ b/client/qiskit_serverless/core/function.py @@ -27,6 +27,7 @@ QiskitFunction """ import dataclasses +import warnings from dataclasses import dataclass from typing import Optional, Dict, List, Any, Tuple @@ -118,14 +119,31 @@ def run(self, **kwargs): config=config, ) + def get_jobs(self): + """List of jobs created in this function. + + Raises: + QiskitServerlessException: validation exception + + Returns: + [Job] : list of jobs + """ + warnings.warn( + "`get_jobs` method has been deprecated. " + "And will be removed in future releases. " + "Please, use `jobs` instead.", + DeprecationWarning, + ) + return self.jobs() + def jobs(self): - """Run function + """List of jobs created in this function. Raises: QiskitServerlessException: validation exception Returns: - Job ids : job executed this function + [Job] : list of jobs """ from qiskit_serverless.core.job import ( # pylint: disable=import-outside-toplevel Job,