Skip to content

Commit

Permalink
Revert change about filtering dataframes (#417)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
fhenneke and harisang authored Nov 8, 2024
1 parent 3ef246d commit a4e9be6
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/fetch/payouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a4e9be6

Please sign in to comment.