feauture: upgrade job.py to results v2 format by default and expose h… #626
Build #20240722.7 had test failures
Details
- Failed: 24 (4.84%)
- Passed: 457 (92.14%)
- Other: 15 (3.02%)
- Total: 496
- 4217 of 5506 lines covered (76.59%)
Annotations
Check failure on line 721 in Build log
azure-pipelines / microsoft.azure-quantum-python.ci
Build log #L721
12 test(s) failed, 248 test(s) collected.
Check failure on line 2191 in Build log
azure-pipelines / microsoft.azure-quantum-python.ci
Build log #L2191
Cmd.exe exited with code '1'.
Check failure on line 1 in tests/unit/test_cirq.py::TestCirq::test_plugins_ionq_cirq
azure-pipelines / microsoft.azure-quantum-python.ci
tests/unit/test_cirq.py::TestCirq::test_plugins_ionq_cirq
self = <test_cirq.TestCirq testMethod=test_plugins_ionq_cirq>
@pytest.mark.ionq
@pytest.mark.live_test
def test_plugins_ionq_cirq(self):
with unittest.mock.patch.object(
Job,
self.mock_create_job_id_name,
return_value=self.get_test_job_id(),
):
workspace = self.create_workspace()
service = AzureQuantumService(workspace=workspace)
> run_result = service.run(
program=self._3_qubit_ghz_cirq(),
repetitions=500,
target="ionq.simulator",
timeout_seconds=60
)
D:\a\1\s\azure-quantum\tests\unit\test_cirq.py:170:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\cirq\service.py:231: in run
result = job.results(timeout_seconds=timeout_seconds)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\cirq_ionq\job.py:221: in results
histogram = self._client.get_results(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <azure.quantum.cirq.targets.ionq._IonQClient object at 0x000001BD6BD2CA90>
job_id = '00000000-0000-0000-0000-000000000001', sharpen = None
extra_query_params = None
def get_results(
self, job_id: str, sharpen: Optional[bool] = None, extra_query_params: Optional[dict] = None
):
azure_job = self._workspace.get_job(job_id)
job_result = azure_job.get_results()
> return job_result["histogram"]
E TypeError: string indices must be integers, not 'str'
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\cirq\targets\ionq.py:80: TypeError
Raw output
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\cirq\targets\ionq.py:80: TypeError: string indices must be integers, not 'str'
Check failure on line 1 in tests/unit/test_qiskit.py::TestQiskit::test_plugins_retrieve_job
azure-pipelines / microsoft.azure-quantum-python.ci
tests/unit/test_qiskit.py::TestQiskit::test_plugins_retrieve_job
self = <test_qiskit.TestQiskit testMethod=test_plugins_retrieve_job>
@pytest.mark.ionq
@pytest.mark.live_test
def test_plugins_retrieve_job(self):
workspace = self.create_workspace()
provider = AzureQuantumProvider(workspace=workspace)
backend = provider.get_backend("ionq.simulator")
circuit = self._3_qubit_ghz()
qiskit_job = backend.run(circuit, shots=100)
# Make sure the job is completed before fetching the results
self._qiskit_wait_to_complete(qiskit_job, provider)
if JobStatus.DONE == qiskit_job.status():
fetched_job = backend.retrieve_job(qiskit_job.id())
self.assertEqual(fetched_job.id(), qiskit_job.id())
> result = fetched_job.result()
D:\a\1\s\azure-quantum\tests\unit\test_qiskit.py:816:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\qiskit\job.py:87: in result
results = self._format_results(sampler_seed=sampler_seed)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\qiskit\job.py:149: in _format_results
job_result["data"] = self._format_ionq_results(sampler_seed=sampler_seed)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\qiskit\job.py:188: in _format_ionq_results
az_result = self._azure_job.get_results()
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\job\job.py:140: in get_results
payload = self.download_data(self.details.output_data_uri)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\job\base_job.py:285: in download_data
payload = download_blob(blob_uri_with_sas_token)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\storage.py:194: in download_blob
response = blob_client.download_blob().readall()
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\storage\blob\_download.py:739: in readall
return self.read()
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\storage\blob\_download.py:695: in read
downloader.process_chunk(chunk)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\storage\blob\_download.py:128: in process_chunk
chunk_data, _ = self._download_chunk(chunk_start, chunk_end - 1)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\storage\blob\_download.py:202: in _download_chunk
_, response = self.client.download(
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\tracing\decorator.py:94: in wrapper_use_tracer
return func(*args, **kwargs)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\storage\blob\_generated\operations\_blob_operations.py:1608: in download
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:229: in run
return first_node.send(pipeline_request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:86: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:86: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:86: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:86: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:86: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\policies\_redirect.py:197: in send
response = self.next.send(request)
C:\hosted
Raw output
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\vcr\stubs\__init__.py:263: vcr.errors.CannotOverwriteExistingCassetteException: Can't overwrite existing cassette ('D:\\a\\1\\s\\azure-quantum\\tests\\unit\\recordings\\test_plugins_retrieve_job.yaml') in your current record mode ('once').
azure-pipelines / microsoft.azure-quantum-python.ci
tests/unit/test_qiskit.py::TestQiskit::test_plugins_submit_qiskit_circuit_as_list_to_ionq
self = <test_qiskit.TestQiskit testMethod=test_plugins_submit_qiskit_circuit_as_list_to_ionq>
@pytest.mark.ionq
@pytest.mark.live_test
def test_plugins_submit_qiskit_circuit_as_list_to_ionq(self):
circuit = self._3_qubit_ghz()
> self._test_qiskit_submit_ionq([circuit])
D:\a\1\s\azure-quantum\tests\unit\test_qiskit.py:417:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
D:\a\1\s\azure-quantum\tests\unit\test_qiskit.py:528: in _test_qiskit_submit_ionq
result = qiskit_job.result()
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\qiskit\job.py:87: in result
results = self._format_results(sampler_seed=sampler_seed)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\qiskit\job.py:149: in _format_results
job_result["data"] = self._format_ionq_results(sampler_seed=sampler_seed)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\qiskit\job.py:188: in _format_ionq_results
az_result = self._azure_job.get_results()
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\job\job.py:140: in get_results
payload = self.download_data(self.details.output_data_uri)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\job\base_job.py:285: in download_data
payload = download_blob(blob_uri_with_sas_token)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\storage.py:194: in download_blob
response = blob_client.download_blob().readall()
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\storage\blob\_download.py:739: in readall
return self.read()
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\storage\blob\_download.py:695: in read
downloader.process_chunk(chunk)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\storage\blob\_download.py:128: in process_chunk
chunk_data, _ = self._download_chunk(chunk_start, chunk_end - 1)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\storage\blob\_download.py:202: in _download_chunk
_, response = self.client.download(
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\tracing\decorator.py:94: in wrapper_use_tracer
return func(*args, **kwargs)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\storage\blob\_generated\operations\_blob_operations.py:1608: in download
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:229: in run
return first_node.send(pipeline_request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:86: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:86: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:86: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:86: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:86: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\policies\_redirect.py:197: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:86: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\storage\blob\_shared\policies.py:529: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\cor
Raw output
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\vcr\stubs\__init__.py:263: vcr.errors.CannotOverwriteExistingCassetteException: Can't overwrite existing cassette ('D:\\a\\1\\s\\azure-quantum\\tests\\unit\\recordings\\test_plugins_submit_qiskit_circuit_as_list_to_ionq.yaml') in your current record mode ('once').
azure-pipelines / microsoft.azure-quantum-python.ci
tests/unit/test_qiskit.py::TestQiskit::test_plugins_submit_qiskit_qobj_to_ionq
self = <test_qiskit.TestQiskit testMethod=test_plugins_submit_qiskit_qobj_to_ionq>
@pytest.mark.ionq
@pytest.mark.live_test
def test_plugins_submit_qiskit_qobj_to_ionq(self):
from qiskit import assemble
circuit = self._3_qubit_ghz()
qobj = assemble(circuit)
> self._test_qiskit_submit_ionq(circuit=qobj, shots=1024)
D:\a\1\s\azure-quantum\tests\unit\test_qiskit.py:440:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
D:\a\1\s\azure-quantum\tests\unit\test_qiskit.py:528: in _test_qiskit_submit_ionq
result = qiskit_job.result()
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\qiskit\job.py:87: in result
results = self._format_results(sampler_seed=sampler_seed)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\qiskit\job.py:149: in _format_results
job_result["data"] = self._format_ionq_results(sampler_seed=sampler_seed)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\qiskit\job.py:188: in _format_ionq_results
az_result = self._azure_job.get_results()
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\job\job.py:140: in get_results
payload = self.download_data(self.details.output_data_uri)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\job\base_job.py:285: in download_data
payload = download_blob(blob_uri_with_sas_token)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\quantum\storage.py:194: in download_blob
response = blob_client.download_blob().readall()
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\storage\blob\_download.py:739: in readall
return self.read()
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\storage\blob\_download.py:695: in read
downloader.process_chunk(chunk)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\storage\blob\_download.py:128: in process_chunk
chunk_data, _ = self._download_chunk(chunk_start, chunk_end - 1)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\storage\blob\_download.py:202: in _download_chunk
_, response = self.client.download(
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\tracing\decorator.py:94: in wrapper_use_tracer
return func(*args, **kwargs)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\storage\blob\_generated\operations\_blob_operations.py:1608: in download
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:229: in run
return first_node.send(pipeline_request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:86: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:86: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:86: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:86: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:86: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\policies\_redirect.py:197: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\core\pipeline\_base.py:86: in send
response = self.next.send(request)
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\azure\storage\blob\_shared\policies.py:529: in send
response = self.next.send(request)
C:\ho
Raw output
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\site-packages\vcr\stubs\__init__.py:263: vcr.errors.CannotOverwriteExistingCassetteException: Can't overwrite existing cassette ('D:\\a\\1\\s\\azure-quantum\\tests\\unit\\recordings\\test_plugins_submit_qiskit_qobj_to_ionq.yaml') in your current record mode ('once').