frankgh commented on code in PR #3766:
URL: https://github.com/apache/cassandra/pull/3766#discussion_r1901205788


##########
pylib/cqlshlib/cql3handling.py:
##########
@@ -1611,32 +1611,23 @@ def permission_completer(ctxt, _):
 
 @completer_for('username', 'name')
 def username_name_completer(ctxt, cass):
-    def maybe_quote(name):
-        if CqlRuleSet.is_valid_cql3_name(name):
-            return name
-        return "'%s'" % name
-
     # disable completion for CREATE USER.
     if ctxt.matched[0][1].upper() == 'CREATE':
         return [Hint('<username>')]
 
     session = cass.session
-    return [maybe_quote(list(row.values())[0].replace("'", "''")) for row in 
session.execute("LIST USERS")]
+    return map(maybe_escape_name, [row['name'] for row in 
session.execute("LIST USERS")])

Review Comment:
   to me it feels like it's more of a legacy method name : 
https://github.com/datastax/python-driver/commit/0959b5dc1662d6957f2951738d0a4f053ac78f66
 and not really a higher abstraction. But I don't have a lot of context on the 
history of these method names



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to