Skip to content

Commit 793421a

Browse files
fruchdkropachev
authored andcommitted
cqlengine/management.py: handle more options of views names
so far the code assumed view can be name like: ```python possible_names = [name, f'values({name})'] ``` we have now one more option, that need to be considered: ```python f'keys({name})' ```
1 parent 873545e commit 793421a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cassandra/cqlengine/management.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,10 @@ def _get_index_name_by_column(table, column_name):
153153
Find the index name for a given table and column.
154154
"""
155155
protected_name = metadata.protect_name(column_name)
156-
possible_index_values = [protected_name, "values(%s)" % protected_name]
156+
possible_index_values = [protected_name, "values(%s)" % protected_name, "keys(%s)" % protected_name]
157157
for index_metadata in table.indexes.values():
158158
options = dict(index_metadata.index_options)
159+
159160
if options.get('target') in possible_index_values:
160161
return index_metadata.name
161162

0 commit comments

Comments
 (0)