Skip to content

Commit

Permalink
Convert as_orderedmap in C to KeyOrderedDict in Python
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannguyen4 committed Feb 8, 2024
1 parent 519a976 commit 21ee623
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/conversions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 21ee623

Please sign in to comment.