From a4e9be6198a6f0567e0838eab3f4773512f5bbb4 Mon Sep 17 00:00:00 2001 From: Felix Henneke Date: Fri, 8 Nov 2024 01:45:53 +0100 Subject: [PATCH] Revert change about filtering dataframes (#417) This PR reverts a change introduces in #407. The PR introduced a somewhat unrelated change to filter duplicate columns from data frames before merging. In local testing it seems that the data frames do not actually contain such columns. Thus, the somewhat difficult to read code fragment does not have any effect. If the code is indeed required, I would suggest restructuring it for clarity. If it is important that this column only appears in one data frame, one could add a check to `validate_df_columns`. Co-authored-by: Haris Angelidakis <64154020+harisang@users.noreply.github.com> --- src/fetch/payouts.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/fetch/payouts.py b/src/fetch/payouts.py index 6586f267..6e3b48cd 100644 --- a/src/fetch/payouts.py +++ b/src/fetch/payouts.py @@ -399,19 +399,10 @@ def construct_payout_dataframe( normalize_address_field(service_fee_df, join_column) # 3. Merge the three dataframes (joining on solver) - - reward_target_reduced_df_columns = [ - x for x in list(reward_target_df.columns) if x != "solver_name" - ] - reward_target_reduced_df = reward_target_df[reward_target_reduced_df_columns] - service_fee_reduced_df_columns = [ - x for x in list(service_fee_df.columns) if x != "solver_name" - ] - service_fee_reduced_df = service_fee_df[service_fee_reduced_df_columns] merged_df = ( payment_df.merge(slippage_df, on=join_column, how="left") - .merge(reward_target_reduced_df, on=join_column, how="left") - .merge(service_fee_reduced_df, on=join_column, how="left") + .merge(reward_target_df, on=join_column, how="left") + .merge(service_fee_df, on=join_column, how="left") ) # 4. Add slippage from fees to slippage