Skip to content

Commit

Permalink
Deprecate get_jobs method (#1488)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tansito authored Sep 11, 2024
1 parent be6123b commit ae774a9
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions client/qiskit_serverless/core/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
QiskitFunction
"""
import dataclasses
import warnings
from dataclasses import dataclass
from typing import Optional, Dict, List, Any, Tuple

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit ae774a9

Please sign in to comment.