Skip to content

Commit aeb8fe6

Browse files
committed
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 b35f24c commit aeb8fe6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cassandra/cqlengine/management.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,10 @@ def _get_index_name_by_column(table, column_name):
154154
Find the index name for a given table and column.
155155
"""
156156
protected_name = metadata.protect_name(column_name)
157-
possible_index_values = [protected_name, "values(%s)" % protected_name]
157+
possible_index_values = [protected_name, "values(%s)" % protected_name, "keys(%s)" % protected_name]
158158
for index_metadata in table.indexes.values():
159159
options = dict(index_metadata.index_options)
160+
160161
if options.get('target') in possible_index_values:
161162
return index_metadata.name
162163

0 commit comments

Comments
 (0)