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

Fixing AerJob::status() method to deal with Python's Future #1215

Merged
merged 2 commits into from Nov 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Expand Up @@ -61,6 +61,7 @@ Fixed
- Fixed horizontal spacing when drawing barriers before CCNOT gates in latex
circuit plots (#1051)
- Use case insensitive matching when comparing premium account URLs. (#1102)
- Fixed AerJob status when the submitted Job is in a PENDING state. (#1215)

Removed
-------
Expand Down
8 changes: 6 additions & 2 deletions qiskit/backends/aer/aerjob.py
Expand Up @@ -114,8 +114,12 @@ def status(self):
elif self._future.done():
_status = JobStatus.DONE if self._future.exception() is None else JobStatus.ERROR
else:
raise JobError('Unexpected behavior of {0}'.format(
self.__class__.__name__))
# Note: There is an undocumented Future state: PENDING, that seems to show up when
# the job is enqueued, waiting for someone to pick it up. We need to deal with this
# state but there's no public API for it, so we are assuming that if the job is not
# in any of the previous states, is PENDING, ergo INITIALIZING for us.
_status = JobStatus.INITIALIZING

return _status

def backend_name(self):
Expand Down