Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate get_jobs method #1488

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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