Fix formatting of duration columns in CQLSH

patch by Akhil Mehra; reviewed by Benjamin Lerer for CASSANDRA-13549
This commit is contained in:
Akhil Mehra 2017-05-29 17:31:57 +02:00 committed by Benjamin Lerer
parent 60c2004963
commit 5a860a70f2
4 changed files with 2 additions and 5 deletions

View File

@ -1,4 +1,5 @@
3.11.0
* Fix formatting of duration columns in CQLSH (CASSANDRA-13549)
* Fix the problem with duplicated rows when using paging with SASI (CASSANDRA-13302)
* Allow CONTAINS statements filtering on the partition key and its parts (CASSANDRA-13275)
* Fall back to even ranges calculation in clusters with vnodes when tokens are distributed unevenly (CASSANDRA-13229)

Binary file not shown.

View File

@ -396,11 +396,7 @@ def format_value_time(val, colormap, **_):
@formatter_for('Duration')
def format_value_duration(val, colormap, **_):
buf = six.iterbytes(val)
months = decode_vint(buf)
days = decode_vint(buf)
nanoseconds = decode_vint(buf)
return format_python_formatted_type(duration_as_str(months, days, nanoseconds), colormap, 'duration')
return format_python_formatted_type(duration_as_str(val.months, val.days, val.nanoseconds), colormap, 'duration')
def duration_as_str(months, days, nanoseconds):