Skip to content

Commit 6abc740

Browse files
splchpavoljuhas
andauthored
remove extra User-Agent prefix in the ionq API header (#6232)
* remove the extra User-Agent prefix * require ionq User-Agent starts with "cirq/" --------- Co-authored-by: Pavol Juhas <juhas@google.com>
1 parent 999fd94 commit 6abc740

3 files changed

Lines changed: 2 additions & 6 deletions

File tree

cirq-ionq/cirq_ionq/ionq_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def _user_agent(self):
291291
"""
292292
cirq_version_string = f'cirq/{cirq_version}'
293293
python_version_string = f'python/{platform.python_version()}'
294-
return f'User-Agent: {cirq_version_string} ({python_version_string})'
294+
return f'{cirq_version_string} ({python_version_string})'
295295

296296
def _target(self, target: Optional[str]) -> str:
297297
"""Returns the target if not None or the default target.

cirq-ionq/cirq_ionq/ionq_client_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def test_ionq_client_attributes():
8484
'Content-Type': 'application/json',
8585
'User-Agent': client._user_agent(),
8686
}
87+
assert client.headers['User-Agent'].startswith('cirq/')
8788
assert client.default_target == 'qpu'
8889
assert client.max_retry_seconds == 10
8990
assert client.verbose is True

cirq-ionq/cirq_ionq/ionq_devices_test.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,3 @@ def test_validate_circuit_valid():
8888
gate_domain={gate: gate.num_qubits() for gate in VALID_GATES},
8989
)
9090
device.validate_circuit(circuit)
91-
92-
93-
def test_decompose_operation_deprecated():
94-
with cirq.testing.assert_deprecated('Use cirq.optimize_for_target_gateset', deadline='v0.16'):
95-
_ = ionq.decompose_to_device(cirq.CZ(*cirq.LineQubit.range(2)))

0 commit comments

Comments
 (0)