mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-03 07:51:49 +00:00
Merge pull request #4332 from OpenBB-finance/hotfix/issue4212
Remove yfinance from news
This commit is contained in:
@@ -8,7 +8,6 @@ from datetime import datetime, timedelta
|
||||
from typing import List, Optional
|
||||
|
||||
import financedatabase as fd
|
||||
import yfinance as yf
|
||||
|
||||
from openbb_terminal import feature_flags as obbff
|
||||
from openbb_terminal.common import feedparser_view, newsapi_view
|
||||
@@ -550,15 +549,9 @@ class StocksController(StockBaseController):
|
||||
self.ticker = ns_parser.ticker
|
||||
self.custom_load_wrapper([self.ticker])
|
||||
if self.ticker:
|
||||
try:
|
||||
d_stock = yf.Ticker(self.ticker).info
|
||||
except TypeError:
|
||||
d_stock = dict()
|
||||
if ns_parser.source == "NewsApi":
|
||||
newsapi_view.display_news(
|
||||
query=d_stock["shortName"].replace(" ", "+")
|
||||
if "shortName" in d_stock
|
||||
else self.ticker,
|
||||
query=self.ticker,
|
||||
limit=ns_parser.limit,
|
||||
start_date=ns_parser.n_start_date.strftime("%Y-%m-%d"),
|
||||
show_newest=ns_parser.n_oldest,
|
||||
@@ -566,9 +559,7 @@ class StocksController(StockBaseController):
|
||||
)
|
||||
elif ns_parser.source == "Feedparser":
|
||||
feedparser_view.display_news(
|
||||
term=d_stock["shortName"].replace(" ", "+")
|
||||
if "shortName" in d_stock
|
||||
else self.ticker,
|
||||
term=self.ticker,
|
||||
sources=ns_parser.sources,
|
||||
limit=ns_parser.limit,
|
||||
export=ns_parser.export,
|
||||
|
||||
@@ -436,14 +436,6 @@ def test_call_func(
|
||||
)
|
||||
|
||||
# MOCK TICKER + INFO
|
||||
mocker.patch(
|
||||
target=f"{path_controller}.yf.Ticker",
|
||||
)
|
||||
mocker.patch(
|
||||
target=f"{path_controller}.yf.Ticker.info",
|
||||
return_value={"shortName": "MOCK_SHORT_NAME"},
|
||||
)
|
||||
|
||||
if mocked_func:
|
||||
mock = mocker.Mock()
|
||||
mocker.patch(
|
||||
|
||||
Reference in New Issue
Block a user