mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-28 04:52:07 +00:00
Fix a big for Yahoo FA when a ticker has no sustainability info
This commit is contained in:
@@ -186,6 +186,10 @@ def sustainability(l_args, s_ticker):
|
||||
|
||||
df_sustainability = stock.sustainability
|
||||
|
||||
if not df_sustainability:
|
||||
print(f"No sustainability information in Yahoo for {s_ticker}")
|
||||
return
|
||||
|
||||
df_sustainability.index = [
|
||||
"".join(
|
||||
" " + char if char.isupper() else char.strip() for char in idx
|
||||
|
||||
@@ -5,9 +5,19 @@ import unittest
|
||||
# pylint: disable=unused-import
|
||||
import pytest
|
||||
|
||||
from gamestonk_terminal.fundamental_analysis.yahoo_finance_api import info
|
||||
from gamestonk_terminal.fundamental_analysis.yahoo_finance_api import (
|
||||
info,
|
||||
sustainability,
|
||||
calendar_earnings,
|
||||
)
|
||||
|
||||
|
||||
class TestFaYahooFinanceApi(unittest.TestCase):
|
||||
def test_info(self):
|
||||
info([], "PLTR")
|
||||
|
||||
def test_sustainability(self):
|
||||
sustainability([], "PLTR")
|
||||
|
||||
def test_calendar_earnings(self):
|
||||
calendar_earnings([], "PLTR")
|
||||
|
||||
Reference in New Issue
Block a user