You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "bschoening (via GitHub)" <gi...@apache.org> on 2026/07/14 20:45:53 UTC

[PR] PEP-8 code style changes [cassandra-python-driver]

bschoening opened a new pull request, #1299:
URL: https://github.com/apache/cassandra-python-driver/pull/1299

   Mostly white space changes


-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] PEP-8 code style changes [cassandra-python-driver]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #1299:
URL: https://github.com/apache/cassandra-python-driver/pull/1299#discussion_r3582529856


##########
cassandra/query.py:
##########
@@ -46,7 +46,7 @@
 
 See https://issues.apache.org/jira/browse/CASSANDRA-7304 for further details on semantics.
 
-.. versionadded:: 2.6.0
+.. version added:: 2.6.0

Review Comment:
   The Sphinx/reST directive here is malformed: `.. versionadded::` is the recognized directive, but `.. version added::` will not be parsed correctly and can break doc builds.



##########
cassandra/concurrent.py:
##########
@@ -89,7 +91,7 @@ def _execute(self, idx, statement, params):
                 callback=self._on_success, callback_args=args,
                 errback=self._on_error, errback_args=args)
         except Exception as exc:
-            # If we're not failing fast and all executions are raising, there is a chance of recursing
+            # If we're not failing fast and all executions are raising, there is a chance of recurring

Review Comment:
   This comment describes recursion depth (`max_error_recursion` / `_exec_depth`), but it was changed to say "recurring". That changes the meaning and makes the comment misleading; it should refer to "recursing" here.



##########
cassandra/cqltypes.py:
##########
@@ -1006,9 +1020,11 @@ def evict_udt_class(cls, keyspace, udt_name):
 
     @classmethod
     def apply_parameters(cls, subtypes, names):
-        keyspace = subtypes[0].cass_parameterized_type()  # when parsed from cassandra type, the keyspace is created as an unrecognized cass type; This gets the name back
+        # when parsed from cassandra type, the keyspace is created as an unrecognized cass type; This resolves the back

Review Comment:
   This inline comment is grammatically incorrect/unclear ("This resolves the back") and no longer explains what the code is doing. It should state that `cass_parameterized_type()` is used to recover the keyspace name when it was parsed as an unrecognized type.



-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] PEP-8 code style changes [cassandra-python-driver]

Posted by "bschoening (via GitHub)" <gi...@apache.org>.
bschoening closed pull request #1299: PEP-8 code style changes
URL: https://github.com/apache/cassandra-python-driver/pull/1299


-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] PEP-8 code style changes [cassandra-python-driver]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #1299:
URL: https://github.com/apache/cassandra-python-driver/pull/1299#discussion_r3582682793


##########
cassandra/metrics.py:
##########
@@ -123,22 +123,22 @@ def __init__(self, cluster_proxy):
         self.stats_name = 'cassandra-{0}'.format(str(self._stats_counter))
         Metrics._stats_counter += 1
         self.stats = scales.collection(self.stats_name,
-            scales.PmfStat('request_timer'),
-            scales.IntStat('connection_errors'),
-            scales.IntStat('write_timeouts'),
-            scales.IntStat('read_timeouts'),
-            scales.IntStat('unavailables'),
-            scales.IntStat('other_errors'),
-            scales.IntStat('retries'),
-            scales.IntStat('ignores'),
-
-            # gauges
-            scales.Stat('known_hosts',
-                lambda: len(cluster_proxy.metadata.all_hosts())),
-            scales.Stat('connected_to',
-                lambda: len(set(chain.from_iterable(s._pools.keys() for s in cluster_proxy.sessions)))),
-            scales.Stat('open_connections',
-                lambda: sum(sum(p.open_count for p in s._pools.values()) for s in cluster_proxy.sessions)))
+                                       scales.PmfStat('request_timer'),
+                                       scales.IntStat('connection_errors'),
+                                       scales.IntStat('write_timeouts'),
+                                       scales.IntStat('read_timeouts'),

Review Comment:
   The continuation indentation inside the scales.collection(...) call is inconsistent (the "# gauges" block is indented differently than the preceding arguments), which can trip indentation lint rules and hurts readability. Consider using a standard hanging-indent style for the whole call.



-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: [PR] PEP-8 code style changes [cassandra-python-driver]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #1299:
URL: https://github.com/apache/cassandra-python-driver/pull/1299#discussion_r3582620375


##########
cassandra/cqltypes.py:
##########
@@ -1006,9 +1020,11 @@ def evict_udt_class(cls, keyspace, udt_name):
 
     @classmethod
     def apply_parameters(cls, subtypes, names):
-        keyspace = subtypes[0].cass_parameterized_type()  # when parsed from cassandra type, the keyspace is created as an unrecognized cass type; This gets the name back
+        # when parsed from cassandra type, the keyspace is created as an unrecognized cass type; This resolves the back

Review Comment:
   This comment is now grammatically incorrect ("This resolves the back") and no longer explains what the line is doing. It looks like it was intended to say we’re getting the keyspace name back from the parsed type.



##########
cassandra/metrics.py:
##########
@@ -123,22 +123,22 @@ def __init__(self, cluster_proxy):
         self.stats_name = 'cassandra-{0}'.format(str(self._stats_counter))
         Metrics._stats_counter += 1
         self.stats = scales.collection(self.stats_name,
-            scales.PmfStat('request_timer'),
-            scales.IntStat('connection_errors'),
-            scales.IntStat('write_timeouts'),
-            scales.IntStat('read_timeouts'),
-            scales.IntStat('unavailables'),
-            scales.IntStat('other_errors'),
-            scales.IntStat('retries'),
-            scales.IntStat('ignores'),
-
-            # gauges
-            scales.Stat('known_hosts',
-                lambda: len(cluster_proxy.metadata.all_hosts())),
-            scales.Stat('connected_to',
-                lambda: len(set(chain.from_iterable(s._pools.keys() for s in cluster_proxy.sessions)))),
-            scales.Stat('open_connections',
-                lambda: sum(sum(p.open_count for p in s._pools.values()) for s in cluster_proxy.sessions)))
+                                       scales.PmfStat('request_timer'),
+                                       scales.IntStat('connection_errors'),
+                                       scales.IntStat('write_timeouts'),
+                                       scales.IntStat('read_timeouts'),
+                                       scales.IntStat('unavailables'),
+                                       scales.IntStat('other_errors'),
+                                       scales.IntStat('retries'),
+                                       scales.IntStat('ignores'),
+
+                                        # gauges
+                                        scales.Stat('known_hosts',
+                                            lambda: len(cluster_proxy.metadata.all_hosts())),
+                                        scales.Stat('connected_to',
+                                            lambda: len(set(chain.from_iterable(s._pools.keys() for s in cluster_proxy.sessions)))),
+                                        scales.Stat('open_connections',
+                                            lambda: sum(sum(p.open_count for p in s._pools.values()) for s in cluster_proxy.sessions)))

Review Comment:
   Within this scales.collection(...) call, the gauge section is indented one extra space compared to the preceding arguments, making the continuation indentation inconsistent and harder to read.



##########
cassandra/concurrent.py:
##########
@@ -89,7 +91,7 @@ def _execute(self, idx, statement, params):
                 callback=self._on_success, callback_args=args,
                 errback=self._on_error, errback_args=args)
         except Exception as exc:
-            # If we're not failing fast and all executions are raising, there is a chance of recursing
+            # If we're not failing fast and all executions are raising, there is a chance of recurring

Review Comment:
   The comment should refer to recursion (this code tracks _exec_depth/max_error_recursion). "Recurring" changes the meaning and makes the comment misleading.



-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org