From 5b69edda86b744ed4316d4b3a536fa93a68e50bc Mon Sep 17 00:00:00 2001 From: Vishal Grover Date: Sat, 16 Nov 2024 14:13:17 +0000 Subject: [PATCH] Fix for #1408 Replaced DataFrame.append with DataFrame.concat, a df.empty check is not required but avoids the FutureWarning about dtype of an empty DataFrame in concat --- sysproduction/reporting/data/rolls.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sysproduction/reporting/data/rolls.py b/sysproduction/reporting/data/rolls.py index e3343c51cd..259aac5b6d 100644 --- a/sysproduction/reporting/data/rolls.py +++ b/sysproduction/reporting/data/rolls.py @@ -458,8 +458,12 @@ def last_price_data_with_matched_contracts(df_of_col_and_col_to_use): ): row_to_copy = df_of_col_and_col_to_use[ ["Price_to_find", "Price_infer_from"] - ].iloc[data_row_idx] - matched_df_dict = matched_df_dict.append(row_to_copy) + ].iloc[[data_row_idx]] + + if matched_df_dict.empty: + matched_df_dict = row_to_copy + else: + matched_df_dict = pd.concat([matched_df_dict, row_to_copy]) else: # We're full break