def create_table_of_types(self):
     """
     Builds a table containing all the numpy types
     """
     base_ddl = '''CREATE TABLE {0}.{1} (k int PRIMARY KEY'''.format(self.keyspace_name, self.function_table_name, type)
     for key, value in NumpyNullTest.NUMPY_TYPES.items():
         base_ddl = base_ddl+", {0} {1}".format(key, value[0])
     base_ddl = base_ddl+")"
     execute_with_retry_tolerant(self.session, base_ddl, (DriverException, NoHostAvailable, Timeout), (ConfigurationException, AlreadyExists))
Example #2
0
 def create_table_of_types(self):
     """
     Builds a table containing all the numpy types
     """
     base_ddl = '''CREATE TABLE {0}.{1} (k int PRIMARY KEY'''.format(self.keyspace_name, self.function_table_name, type)
     for key, value in NumpyNullTest.NUMPY_TYPES.items():
         base_ddl = base_ddl+", {0} {1}".format(key, value[0])
     base_ddl = base_ddl+")"
     execute_with_retry_tolerant(self.session, base_ddl, (DriverException, NoHostAvailable, Timeout), (ConfigurationException, AlreadyExists))
 def validate_types(self):
     """
     Selects each type from the table and expects either an exception or None depending on type
     """
     for key, value in NumpyNullTest.NUMPY_TYPES.items():
         select = "SELECT {0} from {1}.{2}".format(key,self.keyspace_name, self.function_table_name)
         if value[1]:
             rs = execute_with_retry_tolerant(self.session, select, (NoHostAvailable), ())
             self.assertEqual(rs[0].get('v1'), None)
         else:
             with self.assertRaises(ValueError):
                 execute_with_retry_tolerant(self.session, select, (NoHostAvailable), ())
Example #4
0
 def validate_types(self):
     """
     Selects each type from the table and expects either an exception or None depending on type
     """
     for key, value in NumpyNullTest.NUMPY_TYPES.items():
         select = "SELECT {0} from {1}.{2}".format(key,self.keyspace_name, self.function_table_name)
         if value[1]:
             rs = execute_with_retry_tolerant(self.session, select, (NoHostAvailable), ())
             self.assertEqual(rs[0].get('v1'), None)
         else:
             with self.assertRaises(ValueError):
                 execute_with_retry_tolerant(self.session, select, (NoHostAvailable), ())