From 776b03dbb69b115e31a3a307acab7f42beda16f9 Mon Sep 17 00:00:00 2001 From: Jessie Yu Date: Wed, 28 Feb 2024 13:20:36 -0500 Subject: [PATCH] match server encoding --- qiskit_ibm_runtime/utils/json.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qiskit_ibm_runtime/utils/json.py b/qiskit_ibm_runtime/utils/json.py index cd8368082..2688ed60a 100644 --- a/qiskit_ibm_runtime/utils/json.py +++ b/qiskit_ibm_runtime/utils/json.py @@ -289,7 +289,7 @@ def default(self, obj: Any) -> Any: # pylint: disable=arguments-differ "field_names": obj._FIELDS, "field_types": [str(field_type) for field_type in obj._FIELD_TYPES], "shape": obj._SHAPE, - "values": {field_name: getattr(obj, field_name) for field_name in obj._FIELDS}, + "fields": {field_name: getattr(obj, field_name) for field_name in obj._FIELDS}, } return {"__type__": "DataBin", "__value__": out_val} if isinstance(obj, EstimatorPub): @@ -409,7 +409,7 @@ def object_hook(self, obj: Any) -> Any: if shape is not None and isinstance(shape, list): shape = tuple(shape) data_bin_cls = make_data_bin(zip(field_names, field_types), shape=shape) - return data_bin_cls(**obj_val["values"]) + return data_bin_cls(**obj_val["fields"]) if obj_type == "PubResult": return PubResult(**obj_val) if obj_type == "PrimitiveResult":