From 2c0f89eab4e834f6d69607bcf69b4d5b8289a1b5 Mon Sep 17 00:00:00 2001 From: "didierlopes.eth" Date: Sat, 30 Apr 2022 18:20:40 +0100 Subject: [PATCH] minor output formatting (#1749) * minor fix * typo * typo --- openbb_terminal/stocks/stocks_helper.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/openbb_terminal/stocks/stocks_helper.py b/openbb_terminal/stocks/stocks_helper.py index f7cbc30a3bc..2c57c64fded 100644 --- a/openbb_terminal/stocks/stocks_helper.py +++ b/openbb_terminal/stocks/stocks_helper.py @@ -312,7 +312,7 @@ def load( symbol=ticker, outputsize="full" ) except Exception as e: - console.print(e) + console.print(e, "") return pd.DataFrame() df_stock_candidate.columns = [ @@ -369,7 +369,6 @@ def load( # IEX Cloud Source elif source == "iex": - df_stock_candidate = pd.DataFrame() try: @@ -380,11 +379,13 @@ def load( # Check that loading a stock was not successful if df_stock_candidate.empty: console.print("No data found.\n") + return df_stock_candidate + except Exception as e: if "The API key provided is not valid" in str(e): console.print("[red]Invalid API Key[/red]\n") else: - console.print(e) + console.print(e, "\n") return df_stock_candidate @@ -403,6 +404,7 @@ def load( ) df_stock_candidate.sort_index(ascending=True, inplace=True) + s_start = df_stock_candidate.index[0] s_interval = f"{interval}min" int_string = "Daily" if interval == 1440 else "Intraday"