From 21ee623ba6092a8c1a3c6d31807cd0a31b1b543e Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 8 Feb 2024 10:08:32 -0800 Subject: [PATCH] Convert as_orderedmap in C to KeyOrderedDict in Python --- src/main/conversions.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/conversions.c b/src/main/conversions.c index 248368819f..b11fc4b49a 100644 --- a/src/main/conversions.c +++ b/src/main/conversions.c @@ -1662,6 +1662,11 @@ as_status map_to_pyobject(AerospikeClient *self, as_error *err, const as_map *map, PyObject **py_map) { *py_map = PyDict_New(); + // as_orderedmap has flags set to 1 + if (map->flags == 1) { + PyObject *key_ordered_dict_class = AerospikeKeyOrderedDict_Get_Type(); + *py_map = PyObject_CallFunctionObjArgs(key_ordered_dict_class, *py_map); + } if (!*py_map) { return as_error_update(err, AEROSPIKE_ERR_CLIENT,