Skip to content

Commit e4707b0

Browse files
committed
log.warn() --> log.warning()
1 parent 0705175 commit e4707b0

4 files changed

Lines changed: 17 additions & 16 deletions

File tree

cassandra/cluster.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,8 +1050,8 @@ def refresh_schema(self, keyspace=None, table=None, usertype=None, schema_agreem
10501050
Synchronously refresh the schema metadata.
10511051
By default timeout for this operation is governed by :attr:`~.Cluster.max_schema_agreement_wait`
10521052
and :attr:`~.Cluster.control_connection_timeout`.
1053-
Passing schema_agreement_wait here overrides :attr:`~.Cluster.max_schema_agreement_wait`. Setting
1054-
schema_agreement_wait <= 0 will bypass schema agreement and refresh schema immediately.
1053+
Passing schema_agreement_wait here overrides :attr:`~.Cluster.max_schema_agreement_wait`.
1054+
Setting schema_agreement_wait <= 0 will bypass schema agreement and refresh schema immediately.
10551055
RuntimeWarning is raised if schema refresh fails for any reason.
10561056
"""
10571057
if not self.control_connection.refresh_schema(keyspace, table, usertype, schema_agreement_wait):
@@ -2007,8 +2007,8 @@ def _handle_results(success, result):
20072007
log.debug("[control connection] triggers table not found")
20082008
triggers_result = {}
20092009
elif isinstance(triggers_result, Unauthorized):
2010-
log.warn("[control connection] this version of Cassandra does not allow access to schema_triggers metadata with authorization enabled (CASSANDRA-7967); "
2011-
"The driver will operate normally, but will not reflect triggers in the local metadata model, or schema strings.")
2010+
log.warning("[control connection] this version of Cassandra does not allow access to schema_triggers metadata with authorization enabled (CASSANDRA-7967); "
2011+
"The driver will operate normally, but will not reflect triggers in the local metadata model, or schema strings.")
20122012
triggers_result = {}
20132013
else:
20142014
raise triggers_result
@@ -2086,7 +2086,7 @@ def _refresh_node_list_and_token_map(self, connection, preloaded_results=None,
20862086

20872087
tokens = row.get("tokens")
20882088
if not tokens:
2089-
log.warn("Excluding host (%s) with no tokens in system.peers table of %s." % (addr, connection.host))
2089+
log.warning("Excluding host (%s) with no tokens in system.peers table of %s." % (addr, connection.host))
20902090
continue
20912091

20922092
found_hosts.add(addr)
@@ -2223,8 +2223,8 @@ def wait_for_schema_agreement(self, connection=None, preloaded_results=None, wai
22232223
self._time.sleep(0.2)
22242224
elapsed = self._time.time() - start
22252225

2226-
log.warn("Node %s is reporting a schema disagreement: %s",
2227-
connection.host, schema_mismatches)
2226+
log.warning("Node %s is reporting a schema disagreement: %s",
2227+
connection.host, schema_mismatches)
22282228
return False
22292229

22302230
def _get_schema_mismatches(self, peers_result, local_result, local_address):

cassandra/metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ def create(cls, strategy_class, options_map):
513513
try:
514514
rs_instance = rs_class(options_map)
515515
except Exception as exc:
516-
log.warn("Failed creating %s with options %s: %s", strategy_name, options_map, exc)
516+
log.warning("Failed creating %s with options %s: %s", strategy_name, options_map, exc)
517517
return None
518518

519519
return rs_instance

cassandra/pool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def run(self):
183183
# call on_exception for logging purposes even if next_delay is None
184184
if self.on_exception(exc, next_delay):
185185
if next_delay is None:
186-
log.warn(
186+
log.warning(
187187
"Will not continue to retry reconnection attempts "
188188
"due to an exhausted retry schedule")
189189
else:

cassandra/query.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,12 @@ def named_tuple_factory(colnames, rows):
103103
try:
104104
Row = namedtuple('Row', clean_column_names)
105105
except Exception:
106-
log.warn("Failed creating named tuple for results with column names %s (cleaned: %s) (see Python 'namedtuple' documentation for details on name rules). "
107-
"Results will be returned with positional names. "
108-
"Avoid this by choosing different names, using SELECT \"<col name>\" AS aliases, "
109-
"or specifying a different row_factory on your Session" %
110-
(colnames, clean_column_names))
106+
log.warning("Failed creating named tuple for results with column names %s (cleaned: %s) "
107+
"(see Python 'namedtuple' documentation for details on name rules). "
108+
"Results will be returned with positional names. "
109+
"Avoid this by choosing different names, using SELECT \"<col name>\" AS aliases, "
110+
"or specifying a different row_factory on your Session" %
111+
(colnames, clean_column_names))
111112
Row = namedtuple('Row', clean_column_names, rename=True)
112113

113114
return [Row(*row) for row in rows]
@@ -190,7 +191,7 @@ class Statement(object):
190191
:class:`~.TokenAwarePolicy` is configured for
191192
:attr:`.Cluster.load_balancing_policy`
192193
193-
It is set implicitly on :class:`.BoundStatement`, and :class:`.BatchStatement`,
194+
It is set implicitly on :class:`.BoundStatement`, and :class:`.BatchStatement`,
194195
but must be set explicitly on :class:`.SimpleStatement`.
195196
196197
.. versionadded:: 2.1.3
@@ -326,7 +327,7 @@ class PreparedStatement(object):
326327
column_metadata = None
327328
query_id = None
328329
query_string = None
329-
keyspace = None # change to prepared_keyspace in major release
330+
keyspace = None # change to prepared_keyspace in major release
330331

331332
routing_key_indexes = None
332333

0 commit comments

Comments
 (0)