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: [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]