Skip to content

Commit d343889

Browse files
committed
Fix non streamin transformation when it is a json
1 parent d84cc4e commit d343889

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

json_to_csv/json_to_csv.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,10 @@ def get_dataframe(list_data_paths, columns=None, path_csv=None, logger=None, sep
351351
# Read json file by chunk
352352
for x in read_jsons_chunks(f, chunk_size=chunk_size):
353353
if j!=0 and (j % chunk_size == 0):
354-
update_csv(path_csv, json_list, columns, sep, int_to_float, remove_null)
355354
logger.info('Iteration ' + str(j) + ': Creating sub dataframe')
356-
json_list = []
355+
if columns:
356+
update_csv(path_csv, json_list, columns, sep, int_to_float, remove_null)
357+
json_list = []
357358
try:
358359
json_list.extend(x)
359360
# Maximum of chunk_size elements were added

0 commit comments

Comments
 (0)