Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Include metadata from get_investments in raw mode. #24

Merged
merged 1 commit into from
Oct 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions peerberrypy/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def get_investments(
ascending_sort: bool = False,
current: bool = True,
raw: bool = False,
) -> Union[pd.DataFrame, list]:
) -> Union[pd.DataFrame, dict]:
"""
If you're going to fetch more than ~350 investments it's recommended to use the get_mass_investments function.
It provides more details about the investments, but has fewer filters available.
Expand Down Expand Up @@ -466,9 +466,9 @@ def get_investments(
investments_data = self._session.request(
url=ENDPOINTS.INVESTMENTS_URI,
params=investment_params,
)['data']
)

return investments_data if raw else pd.DataFrame(investments_data)
return investments_data if raw else pd.DataFrame(investments_data['data'])

def get_mass_investments(
self,
Expand Down
Loading