File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -94,10 +94,11 @@ AS $$
9494 else:
9595 s3 .download_fileobj (bucket, file_path, fd)
9696 fd .flush ()
97- res = plpy .execute (" COPY {table_name} ({column_list}) FROM {filename} {options};" .format(
97+ formatted_column_list = " ({column_list})" .format(column_list= column_list) if column_list else ' '
98+ res = plpy .execute (" COPY {table_name} {formatted_column_list} FROM {filename} {options};" .format(
9899 table_name= table_name,
99100 filename= plpy .quote_literal (fd .name ),
100- column_list = column_list ,
101+ formatted_column_list = formatted_column_list ,
101102 options= options
102103 )
103104 )
@@ -159,10 +160,11 @@ AS $$
159160 else:
160161 s3 .download_fileobj (bucket, file_path, fd)
161162 fd .flush ()
162- res = plpy .execute (" COPY {table_name} ({column_list}) FROM {filename} {options};" .format(
163+ formatted_column_list = " ({column_list})" .format(column_list= column_list) if column_list else ' '
164+ res = plpy .execute (" COPY {table_name} {formatted_column_list} FROM {filename} {options};" .format(
163165 table_name= table_name,
164166 filename= plpy .quote_literal (fd .name ),
165- column_list = column_list ,
167+ formatted_column_list = formatted_column_list ,
166168 options= options
167169 )
168170 )
You can’t perform that action at this time.
0 commit comments