Esempio n. 1
0
 def test_presto_expand_row_data(self):
     datum = {"row_col": [1, "a"]}
     row_column = "row_col"
     row_col_hierarchy = {
         "row_col": {
             "type": "ROW",
             "children": ["row_col.nested_int", "row_col.nested_str"],
         }
     }
     PrestoEngineSpec._expand_row_data(datum, row_column, row_col_hierarchy)
     expected_datum = {
         "row_col": [1, "a"],
         "row_col.nested_int": 1,
         "row_col.nested_str": "a",
     }
     self.assertEqual(datum, expected_datum)
Esempio n. 2
0
 def test_presto_expand_row_data(self):
     datum = {'row_col': [1, 'a']}
     row_column = 'row_col'
     row_col_hierarchy = {
         'row_col': {
             'type': 'ROW',
             'children': ['row_col.nested_int', 'row_col.nested_str'],
         },
     }
     PrestoEngineSpec._expand_row_data(datum, row_column, row_col_hierarchy)
     expected_datum = {
         'row_col': [1, 'a'],
         'row_col.nested_int': 1,
         'row_col.nested_str': 'a',
     }
     self.assertEqual(datum, expected_datum)