Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions aerospike_helpers/operations/list_operations.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -489,18 +489,22 @@ def list_get_by_index(bin_name: str, index, return_type, ctx: Optional[list] = N
A dictionary usable in :meth:`~aerospike.Client.operate` and :meth:`~aerospike.Client.operate_ordered`. The
format of the dictionary should be considered an internal detail, and subject to change.
"""
op_dict = {
if ctx:
return {
OP_KEY: aerospike.OP_LIST_GET_BY_INDEX,
BIN_KEY: bin_name,
RETURN_TYPE_KEY: return_type,
INDEX_KEY: index,
CTX_KEY: ctx,
}

return {
OP_KEY: aerospike.OP_LIST_GET_BY_INDEX,
BIN_KEY: bin_name,
RETURN_TYPE_KEY: return_type,
INDEX_KEY: index,
}

if ctx:
op_dict[CTX_KEY] = ctx

return op_dict


def list_get_by_index_range(bin_name: str, index, return_type, count=None, inverted=False, ctx: Optional[list] = None):
"""Create a list get index range operation.
Expand Down
Loading