Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Fix backend filters bug (#651)
Browse files Browse the repository at this point in the history
* Fix serialization bug

* Revert "Fix serialization bug"

This reverts commit 72a08bc.

* Filter backend filters bug
  • Loading branch information
kt474 authored Jun 5, 2023
1 parent 5583504 commit f8b3433
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions qiskit_ibm_provider/ibm_backend_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ def backends(
self._backends[name] = self._create_backend_obj(
self._backend_configs[name], instance, self._provider._get_hgps()
)
backends.append(self._backends[name])
if self._backends[name]:
backends.append(self._backends[name])
elif instance:
hgp = self._provider._get_hgp(instance=instance)
for backend_name in hgp.backends.keys():
Expand All @@ -180,7 +181,8 @@ def backends(
self._backends[backend_name] = self._create_backend_obj(
self._backend_configs[backend_name], instance
)
backends.append(self._backends[backend_name])
if self._backends[backend_name]:
backends.append(self._backends[backend_name])
else:
hgps = self._provider._get_hgps()
for backend_name, backend_config in self._backends.items():
Expand All @@ -189,7 +191,8 @@ def backends(
self._backends[backend_name] = self._create_backend_obj(
self._backend_configs[backend_name], hgps=hgps
)
backends.append(self._backends[backend_name])
if self._backends[backend_name]:
backends.append(self._backends[backend_name])
# Special handling of the `name` parameter, to support alias resolution.
if name:
aliases = self._aliased_backend_names()
Expand Down

0 comments on commit f8b3433

Please sign in to comment.