Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
4.2
* Removed Python < 2.7 support from formatting.py (CASSANDRA-17694)
* When doing a host replacement, -Dcassandra.broadcast_interval_ms is used to know when to check the ring but checks that the ring wasn't changed in -Dcassandra.ring_delay_ms, changes to ring delay should not depend on when we publish load stats (CASSANDRA-17776)
* When bootstrap fails, CassandraRoleManager may attempt to do read queries that fail with "Cannot read from a bootstrapping node", and increments unavailables counters (CASSANDRA-17754)
* Add guardrail to disallow DROP KEYSPACE commands (CASSANDRA-17767)
Expand Down
15 changes: 2 additions & 13 deletions pylib/cqlshlib/formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,19 +326,8 @@ def format_integer_type(val, colormap, thousands_sep=None, **_):
return colorme(bval, colormap, 'int')


# We can get rid of this in cassandra-2.2
if sys.version_info >= (2, 7):
def format_integer_with_thousands_sep(val, thousands_sep=','):
return "{:,.0f}".format(val).replace(',', thousands_sep)
else:
def format_integer_with_thousands_sep(val, thousands_sep=','):
if val < 0:
return '-' + format_integer_with_thousands_sep(-val, thousands_sep)
result = ''
while val >= 1000:
val, r = divmod(val, 1000)
result = "%s%03d%s" % (thousands_sep, r, result)
return "%d%s" % (val, result)
def format_integer_with_thousands_sep(val, thousands_sep=','):
return "{:,.0f}".format(val).replace(',', thousands_sep)

formatter_for('long')(format_integer_type)
formatter_for('int')(format_integer_type)
Expand Down