Skip to content

Commit

Permalink
Fix for #1408
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Vishal Grover committed Nov 16, 2024
1 parent 02adec3 commit 5b69edd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sysproduction/reporting/data/rolls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5b69edd

Please sign in to comment.