Skip to content

fix set/frozenset as values argument for Connection.select method #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 3 additions & 2 deletions src/tarantool/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,13 @@ def select(self, space_name, values, **kwargs):
values = [(values, )]
elif isinstance(values, (list, tuple, set, frozenset)):
assert len(values) > 0
if isinstance(values[0], (int, long, basestring)): # list of scalars
any_value = next(iter(values))
if isinstance(any_value, (int, long, basestring)): # list of scalars
# This request is looking for several records using single-valued index
# Ex: select(space_no, index_no, [1, 2, 3])
# Transform a list of scalar values to a list of tuples
values = [(v, ) for v in values]
elif isinstance(values[0], (list, tuple)): # list of tuples
elif isinstance(any_value, (list, tuple)): # list of tuples
# This request is looking for serveral records using composite index
pass
else:
Expand Down