File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
openbb_platform/providers/yfinance/openbb_yfinance/models Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -66,11 +66,7 @@ async def aextract_data(
6666 results : list [dict ] = []
6767
6868 def _normalize_news_item (item : dict , sym : str ) -> dict | None :
69- """
70- yfinance get_news() returns items shaped like:
71- {"id": ..., "content": {...}, ...}
72- We must flatten into CompanyNewsData-compatible dict.
73- """
69+ """Flatten the response."""
7470 if not isinstance (item , dict ):
7571 return None
7672
@@ -125,7 +121,7 @@ def _normalize_news_item(item: dict, sym: str) -> dict | None:
125121 return normalized
126122
127123 def _fetch_news (sym : str ) -> list [dict ]:
128- """Runs in a worker thread."""
124+ """Fetch the data in a worker thread."""
129125 raw = Ticker (sym ).get_news () or []
130126 out : list [dict ] = []
131127 for item in raw :
@@ -135,6 +131,7 @@ def _fetch_news(sym: str) -> list[dict]:
135131 return out
136132
137133 async def get_one (sym : str ) -> None :
134+ """Get the data for one ticker symbol."""
138135 try :
139136 items = await asyncio .to_thread (_fetch_news , sym )
140137 except Exception as e :
You can’t perform that action at this time.
0 commit comments