We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ef9f37 commit b68f25fCopy full SHA for b68f25f
cirq-google/cirq_google/engine/engine_program.py
@@ -361,7 +361,9 @@ async def get_circuit_async(self) -> cirq.Circuit:
361
Returns:
362
The program's cirq Circuit.
363
"""
364
- if self._program is None or self._program.code is None:
+ # The code field is an any_pb2.Any and is always set. But if the program has not
365
+ # been fetched this field may be empty, which we can see by checking the type_url.
366
+ if self._program is None or not self._program.code or not self._program.code.type_url:
367
self._program = await self.context.client.get_program_async(
368
self.project_id, self.program_id, True
369
)
0 commit comments