diff --git a/app_worker.py b/app_worker.py index e772ef3..9b06633 100644 --- a/app_worker.py +++ b/app_worker.py @@ -209,7 +209,7 @@ def get_pandas_dfs(): # Convert the dataframes to PyArrow record batches record_batches = ( pa.RecordBatch.from_pandas(df, schema=schema, preserve_index=False, nthreads=1) - for df in itertools.chain((first_df,), pandas_dfs) + for df in itertools.chain((first_df,) if first_df is not None else (), pandas_dfs) ) first_df = None # Free memory used by the first dataframe