Skip to content

Commit

Permalink
amend test and funds
Browse files Browse the repository at this point in the history
  • Loading branch information
ericpien committed Sep 2, 2024
1 parent 3d3175c commit 0e653c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/test_ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ def test_fetch_and_parse(self):
with self.assertRaises(YFDataException):
ticker = yf.Ticker("AAPL", session=self.session) # stock, not funds
ticker.funds_data._fetch_and_parse()
self.fail(f"_fetch_and_parse should have failed when calling for non-funds data: {e}")
self.fail(f"_fetch_and_parse should have failed when calling for non-funds data")

def test_description(self):
for ticker in self.test_tickers:
Expand Down
4 changes: 2 additions & 2 deletions yfinance/scrapers/funds.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def sector_weightings(self) -> pd.DataFrame:
return self._sector_weightings

def _fetch(self, proxy):
modules = ','.join(["quoteType", "summaryProfile", "topHoldings", "fundPerformance", "fundProfile"])
modules = ','.join(["quoteType", "summaryProfile", "topHoldings", "fundProfile"])
params_dict = {"modules": modules, "corsDomain": "finance.yahoo.com", "symbol": self._symbol, "formatted": "false"}
result = self._data.get_raw_json(_QUOTE_SUMMARY_URL_+self._symbol, user_agent_headers=self._data.user_agent_headers, params=params_dict, proxy=proxy)
return result
Expand All @@ -109,7 +109,7 @@ def _fetch_and_parse(self) -> None:
# check quote type
self._quote_type = data["quoteType"]["quoteType"]

# parse "summaryProfile", "topHoldings", "fundProfile", "fundPerformance"
# parse "summaryProfile", "topHoldings", "fundProfile"
self._parse_description(data["summaryProfile"])
self._parse_top_holdings(data["topHoldings"])
self._parse_fund_profile(data["fundProfile"])
Expand Down

0 comments on commit 0e653c9

Please sign in to comment.