diff --git a/openbb_terminal/cryptocurrency/onchain/ethplorer_model.py b/openbb_terminal/cryptocurrency/onchain/ethplorer_model.py index c37293f0243..51ffe4a68fe 100644 --- a/openbb_terminal/cryptocurrency/onchain/ethplorer_model.py +++ b/openbb_terminal/cryptocurrency/onchain/ethplorer_model.py @@ -161,7 +161,7 @@ def make_request( if response.status_code == 200: result = response.json() - if result: + if not result: console.print("No data found") elif response.status_code == 401: @@ -532,7 +532,8 @@ def get_token_historical_price(address) -> pd.DataFrame: prices_df = pd.DataFrame(prices) prices_df["ts"] = prices_df["ts"].apply(lambda x: datetime.fromtimestamp(x)) - prices_df.drop("tmp", axis=1, inplace=True) + if "tmp" in prices_df.columns: + prices_df.drop("tmp", axis=1, inplace=True) return prices_df[ ["date", "open", "close", "high", "low", "volumeConverted", "cap", "average"] diff --git a/openbb_terminal/helper_funcs.py b/openbb_terminal/helper_funcs.py index e3fb8ee67f2..7ad7ecb9e51 100644 --- a/openbb_terminal/helper_funcs.py +++ b/openbb_terminal/helper_funcs.py @@ -190,7 +190,9 @@ def print_rich_table( for idx, values in zip(df.index.tolist(), df.values.tolist()): row = [str(idx)] if show_index else [] row += [ - str(x) if not isinstance(x, float) else f"{x:{floatfmt[idx]}}" + str(x) + if not isinstance(x, float) + else (f"{x:{floatfmt[idx]}}" if x >= 0.01 else f"{x:.2e}") for idx, x in enumerate(values) ] table.add_row(*row)