File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -85,20 +85,15 @@ def execute(self, context):
8585 def get_schema (self , hook , table ):
8686 logging .info ('Initiating schema retrieval.' )
8787 results = list (hook .get_schema (table ))
88- output_dict = {}
88+ output_array = []
8989 for i in results :
90- new = []
9190 new_dict = {}
92- for n in i :
93- if n == 'COLUMN_NAME' :
94- new .insert (0 , i [n ])
95- else :
96- new .insert (1 , i [n ])
97- new = [i for i in new if i .islower ()]
98- if len (new ) == 2 :
99- new_dict [new [0 ]] = new [1 ]
100- output_dict .update (new_dict )
101- self .s3_upload (str (output_dict ), schema = True )
91+ new_dict ['name' ]= i ['COLUMN_NAME' ]
92+ new_dict ['type' ]= i ['COLUMN_TYPE' ]
93+
94+ if len (new_dict ) == 2 :
95+ output_array .append (new_dict )
96+ self .s3_upload (json .dumps (output_array ), schema = True )
10297
10398 def get_records (self , hook ):
10499 logging .info ('Initiating record retrieval.' )
You can’t perform that action at this time.
0 commit comments