def test_presto_get_fields(self):
     cols = [
         {
             "name": "column"
         },
         {
             "name": "column.nested_obj"
         },
         {
             "name": 'column."quoted.nested obj"'
         },
     ]
     actual_results = PrestoEngineSpec._get_fields(cols)
     expected_results = [
         {
             "name": '"column"',
             "label": "column"
         },
         {
             "name": '"column"."nested_obj"',
             "label": "column.nested_obj"
         },
         {
             "name": '"column"."quoted.nested obj"',
             "label": 'column."quoted.nested obj"',
         },
     ]
     for actual_result, expected_result in zip(actual_results,
                                               expected_results):
         self.assertEqual(actual_result.element.name,
                          expected_result["name"])
         self.assertEqual(actual_result.name, expected_result["label"])
Ejemplo n.º 2
0
 def test_presto_get_fields(self):
     cols = [{
         'name': 'column'
     }, {
         'name': 'column.nested_obj'
     }, {
         'name': 'column."quoted.nested obj"'
     }]
     actual_results = PrestoEngineSpec._get_fields(cols)
     expected_results = [{
         'name': '"column"',
         'label': 'column'
     }, {
         'name': '"column"."nested_obj"',
         'label': 'column.nested_obj'
     }, {
         'name': '"column"."quoted.nested obj"',
         'label': 'column."quoted.nested obj"'
     }]
     for actual_result, expected_result in zip(actual_results,
                                               expected_results):
         self.assertEqual(actual_result.element.name,
                          expected_result['name'])
         self.assertEqual(actual_result.name, expected_result['label'])