cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcken...@apache.org
Subject [6/6] cassandra git commit: Merge branch 'cassandra-3.0' into trunk
Date Thu, 18 Feb 2016 00:24:55 GMT
Merge branch 'cassandra-3.0' into trunk


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/9492efb3
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/9492efb3
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/9492efb3

Branch: refs/heads/trunk
Commit: 9492efb3c4ff2cbcdae5944ffd442cda7c50a6c6
Parents: 81ffa52 5dbab32
Author: Joshua McKenzie <jmckenzie@apache.org>
Authored: Wed Feb 17 19:23:32 2016 -0500
Committer: Joshua McKenzie <jmckenzie@apache.org>
Committed: Wed Feb 17 19:24:06 2016 -0500

----------------------------------------------------------------------
 CHANGES.txt                              |  1 +
 bin/cqlsh.py                             | 39 +++++++++++++++++++++++++--
 conf/cqlshrc.sample                      |  3 +++
 pylib/cqlshlib/formatting.py             | 14 +++++++---
 pylib/cqlshlib/test/test_cqlsh_output.py | 18 +++++++++++++
 5 files changed, 69 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9492efb3/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index e6d4c42,a1125f5..b5d0564
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -52,6 -23,6 +52,7 @@@ Merged from 2.2
   * (cqlsh) Support utf-8/cp65001 encoding on Windows (CASSANDRA-11030)
   * Fix paging on DISTINCT queries repeats result when first row in partition changes
     (CASSANDRA-10010)
++ * (cqlsh) Support timezone conversion using pytz (CASSANDRA-10397)
  Merged from 2.1:
   * Use logback setting for 'cassandra -v' command (CASSANDRA-10767)
   * Fix sstableloader to unthrottle streaming by default (CASSANDRA-9714)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9492efb3/bin/cqlsh.py
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9492efb3/pylib/cqlshlib/formatting.py
----------------------------------------------------------------------
diff --cc pylib/cqlshlib/formatting.py
index ef7e3fd,dcd08da..6b88bc7
--- a/pylib/cqlshlib/formatting.py
+++ b/pylib/cqlshlib/formatting.py
@@@ -101,16 -99,16 +101,16 @@@ def color_text(bval, colormap, displayw
  
  DEFAULT_NANOTIME_FORMAT = '%H:%M:%S.%N'
  DEFAULT_DATE_FORMAT = '%Y-%m-%d'
 -DEFAULT_TIMESTAMP_FORMAT = '%Y-%m-%d %H:%M:%S%z'
  
 -if platform.system() == 'Windows':
 -    DEFAULT_TIME_FORMAT = '%Y-%m-%d %H:%M:%S %Z'
 +DEFAULT_TIMESTAMP_FORMAT = os.environ.get('CQLSH_DEFAULT_TIMESTAMP_FORMAT', '')
 +if not DEFAULT_TIMESTAMP_FORMAT:
 +    DEFAULT_TIMESTAMP_FORMAT = '%Y-%m-%d %H:%M:%S.%f%z'
  
  
 -class DateTimeFormat():
 +class DateTimeFormat:
  
      def __init__(self, timestamp_format=DEFAULT_TIMESTAMP_FORMAT, date_format=DEFAULT_DATE_FORMAT,
-                  nanotime_format=DEFAULT_NANOTIME_FORMAT):
+                  nanotime_format=DEFAULT_NANOTIME_FORMAT, timezone=None):
          self.timestamp_format = timestamp_format
          self.date_format = date_format
          self.nanotime_format = nanotime_format

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9492efb3/pylib/cqlshlib/test/test_cqlsh_output.py
----------------------------------------------------------------------
diff --cc pylib/cqlshlib/test/test_cqlsh_output.py
index c398f69,f867312..c54792d
--- a/pylib/cqlshlib/test/test_cqlsh_output.py
+++ b/pylib/cqlshlib/test/test_cqlsh_output.py
@@@ -370,6 -370,24 +370,24 @@@ class TestCqlshOutput(BaseTestCase)
              nnnnnnnn
              """),
          ), env={'TZ': 'Etc/UTC'})
+         try:
+             import pytz  # test only if pytz is available on PYTHONPATH
+             self.assertQueriesGiveColoredOutput((
+                 ('''select timestampcol from has_all_types where num = 0;''', """
+                  timestampcol
+                  MMMMMMMMMMMM
 -                --------------------------
++                ---------------------------------
+ 
 -                 2012-05-14 09:53:20-0300
 -                 GGGGGGGGGGGGGGGGGGGGGGGG
++                 2012-05-14 09:53:20.000000-0300
++                 GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
+ 
+ 
+                 (1 rows)
+                 nnnnnnnn
+                 """),
+             ), env={'TZ': 'America/Sao_Paulo'})
+         except ImportError:
+             pass
  
      def test_boolean_output(self):
          self.assertCqlverQueriesGiveColoredOutput((


Mime
View raw message