Skip to content

Commit 7eaf209

Browse files
deeleeramoneChimdumebiNebolisa
authored andcommitted
lint
1 parent 4c3396a commit 7eaf209

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

openbb_platform/providers/yfinance/openbb_yfinance/models/company_news.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff 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:

0 commit comments

Comments
 (0)