Exemple #1
0
 def test_double(self):
     float_dict = {"bar": ["1.2", "-3.4", "5.4"]}
     self.assertDictEqual(infer_schema(float_dict), {"bar": "double"})
Exemple #2
0
 def test_bool(self):
     boolean_dict = {1: ["0", "1", "0", "0"]}
     self.assertDictEqual(infer_schema(boolean_dict), {1: "bool"})
Exemple #3
0
 def test_bigint(self):
     smallint_dict = {1: ["-32769", "2147483648", "4563", "-1231"]}
     self.assertDictEqual(infer_schema(smallint_dict), {1: "bigint"})
Exemple #4
0
 def test_varchar(self):
     # negative test
     weird_dict = {
         1: ["023", "1.0", "sdfdsf"],
     }
     self.assertDictEqual(infer_schema(boolean_dict), {1: "varchar"})
Exemple #5
0
 def test_smallint(self):
     smallint_dict = {1: ["-32768", "2", "4563", "-1231"]}
     self.assertDictEqual(infer_schema(smallint_dict), {1: "smallint"})