def add_query_kwargs(kwargs, visitor, constraints, index):
(query_const, filter_const) = constraints.remove_index(index)<EOL>kwargs["<STR_LIT>"] = query_const.build(visitor)<EOL>if filter_const:<EOL><INDENT>kwargs["<STR_LIT>"] = filter_const.build(visitor)<EOL><DEDENT>if index.name != "<STR_LIT>":<EOL><INDENT>kwargs["<STR_LIT:index>"] = index.name<EOL><DEDENT>
Construct KeyConditionExpression and FilterExpression