Copilot commented on code in PR #4653:
URL: https://github.com/apache/cassandra/pull/4653#discussion_r2920775321


##########
pylib/cqlshlib/cqlhandling.py:
##########
@@ -132,6 +132,18 @@ def cql_parse(self, text, startsymbol='Start'):
         tokens = self.cql_massage_tokens(tokens)
         return self.parse(startsymbol, tokens, init_bindings={'*SRC*': text})
 
+    def dequote_value(self, cqlword):
+        raise NotImplementedError("Subclasses must implement dequote_value")
+
+    def dequote_name(self, name):
+        raise NotImplementedError("Subclasses must implement dequote_value")
+
+    def escape_value(self, value):
+        raise NotImplementedError("Subclasses must implement dequote_value")
+
+    def escape_name(self, name):
+        raise NotImplementedError("Subclasses must implement dequote_value")

Review Comment:
   The `NotImplementedError` messages appear copy/pasted: `dequote_name` and 
`escape_value` both say subclasses must implement `dequote_value`, which is 
misleading when these methods are called. Update the messages to reference the 
correct method name (and consider keeping messages consistent across all four 
stubs).
   ```suggestion
           raise NotImplementedError("Subclasses must implement dequote_name")
   
       def escape_value(self, value):
           raise NotImplementedError("Subclasses must implement escape_value")
   
       def escape_name(self, name):
           raise NotImplementedError("Subclasses must implement escape_name")
   ```



##########
pylib/cqlshlib/cqlhandling.py:
##########
@@ -132,6 +132,18 @@ def cql_parse(self, text, startsymbol='Start'):
         tokens = self.cql_massage_tokens(tokens)
         return self.parse(startsymbol, tokens, init_bindings={'*SRC*': text})
 
+    def dequote_value(self, cqlword):
+        raise NotImplementedError("Subclasses must implement dequote_value")
+
+    def dequote_name(self, name):
+        raise NotImplementedError("Subclasses must implement dequote_value")
+
+    def escape_value(self, value):
+        raise NotImplementedError("Subclasses must implement dequote_value")
+
+    def escape_name(self, name):
+        raise NotImplementedError("Subclasses must implement dequote_value")

Review Comment:
   `escape_name` raises `NotImplementedError` with a message referring to 
`dequote_value`. This should reference `escape_name` (or the relevant method) 
so failures are actionable.
   ```suggestion
           raise NotImplementedError("Subclasses must implement dequote_name")
   
       def escape_value(self, value):
           raise NotImplementedError("Subclasses must implement escape_value")
   
       def escape_name(self, name):
           raise NotImplementedError("Subclasses must implement escape_name")
   ```



##########
pylib/cqlshlib/saferscanner.py:
##########
@@ -18,6 +18,8 @@
 # regular expressions and throws an error on group references, named groups, or
 # regex in-pattern flags. Any of those can break correct operation of Scanner.
 
+# pylint: disable=no-member
+

Review Comment:
   The file-wide `# pylint: disable=no-member` suppresses all `no-member` 
checks in this module, which can hide real issues unrelated to the known 
false-positives from Python's internal `re` modules. Consider narrowing the 
suppression to the specific lines/blocks that access 
`re.sre_parse`/`re.sre_compile`/`re._parser`/`re._compiler`, or using a more 
targeted disable with an explanation comment.



-- 
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