Skip to content

Commit

Permalink
Fix wrong return type
Browse files Browse the repository at this point in the history
  • Loading branch information
miohtama committed Oct 31, 2024
1 parent 8b68e26 commit 529afbb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions tradingstrategy/utils/groupeduniverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,10 @@ def __init__(
remove_candles_with_zero_volume=remove_candles_with_zero_volume,
forward_fill=forward_fill,
)
if len(groups) > 1:
assert isinstance(self.pairs, DataFrameGroupBy)
# self.pairs = self.df.groupby(by=self.primary_key_column)
self.df = self.pairs.obj
self.pairs = fix_result
else:
self.df = fix_result
self.pairs = fix_result.groupby("pair_id")

assert isinstance(fix_result, DataFrameGroupBy)
self.df = fix_result.obj
self.pairs = fix_result

#: Grouped DataFrame cache for faster lookup
self.candles_cache: dict[PrimaryKey, pd.DataFrame] = {}
Expand Down
2 changes: 1 addition & 1 deletion tradingstrategy/utils/wrangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def fix_dex_price_data(
df = _forward_fill(ff_df, freq, forward_fill_until=forward_fill_until, columns=("open", "high", "low", "close"))
return df
else:
return raw_df
return ff_df


def examine_price_between_time_anomalies(
Expand Down

0 comments on commit 529afbb

Please sign in to comment.