cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dineshjoshi <...@git.apache.org>
Subject [GitHub] cassandra-dtest pull request #41: 14421
Date Tue, 08 Jan 2019 00:59:13 GMT
Github user dineshjoshi commented on a diff in the pull request:

    https://github.com/apache/cassandra-dtest/pull/41#discussion_r245848315
  
    --- Diff: upgrade_tests/thrift_upgrade_test.py ---
    @@ -10,99 +10,182 @@
                                                ColumnParent, ConsistencyLevel,
                                                SlicePredicate, SliceRange)
     from thrift_test import _i64, get_thrift_client
    -from tools.assertions import assert_length_equal
    +from tools.assertions import assert_length_equal, assert_lists_of_dicts_equal
    +from tools.misc import wait_for_agreement, add_skip
     from .upgrade_base import UpgradeTester
     from .upgrade_manifest import build_upgrade_pairs
     
     since = pytest.mark.since
     logger = logging.getLogger(__name__)
     
     
    -def _create_dense_super_cf(name):
    -    return Cassandra.CfDef('ks', name, column_type='Super',
    +def _create_dense_super_cf(thrift, name):
    +    cfdef = Cassandra.CfDef('ks', name, column_type='Super',
                                key_validation_class='AsciiType',        # pk
                                comparator_type='AsciiType',             # ck
                                default_validation_class='AsciiType',    # SC value
                                subcomparator_type='LongType')           # SC key
    +    thrift.system_add_column_family(cfdef)
    +    wait_for_agreement(thrift)
     
     
    -def _create_sparse_super_cf(name):
    -    cd1 = ColumnDef('col1', 'LongType', None, None)
    -    cd2 = ColumnDef('col2', 'LongType', None, None)
    -    return Cassandra.CfDef('ks', name, column_type='Super',
    +def _create_sparse_super_cf(thrift, name):
    +    cd1 = ColumnDef('col1'.encode(), 'LongType', None, None)
    +    cd2 = ColumnDef('col2'.encode(), 'LongType', None, None)
    +    cfdef = Cassandra.CfDef('ks', name, column_type='Super',
                                column_metadata=[cd1, cd2],
                                key_validation_class='AsciiType',
                                comparator_type='AsciiType',
                                subcomparator_type='AsciiType')
    +    thrift.system_add_column_family(cfdef)
    +    wait_for_agreement(thrift)
     
     
    -def _validate_sparse_cql(cursor, cf='sparse_super_1', column1='column1', col1='col1',
col2='col2', key='key'):
    +def unpack(list):
    --- End diff --
    
    `list` is a Python keyword - https://docs.python.org/3/tutorial/datastructures.html#more-on-lists
    
    You should not use `list` as a variable name. Although Python doesn't complain it's not
a good practice.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Mime
View raw message