From 45bfac29bb22540e524d24c6c6f0a73f381cab1d Mon Sep 17 00:00:00 2001 From: hjoaquim Date: Tue, 14 May 2024 01:12:17 +0100 Subject: [PATCH] proper handling of sheet name --- cli/openbb_cli/controllers/base_platform_controller.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cli/openbb_cli/controllers/base_platform_controller.py b/cli/openbb_cli/controllers/base_platform_controller.py index 6b9584e5dabd..27c6516a838a 100644 --- a/cli/openbb_cli/controllers/base_platform_controller.py +++ b/cli/openbb_cli/controllers/base_platform_controller.py @@ -189,7 +189,7 @@ def method(self, other_args: List[str], translator=translator): if hasattr(ns_parser, "chart") and ns_parser.chart: obbject.show() - fig = obbject.chart.fig + fig = obbject.chart.fig if obbject.chart else None else: if isinstance(df.columns, pd.RangeIndex): df.columns = [str(i) for i in df.columns] @@ -208,10 +208,9 @@ def method(self, other_args: List[str], translator=translator): and ns_parser.export and not df.empty ): - if hasattr(ns_parser, "sheet_name") and isinstance( - ns_parser.sheet_name, list - ): - sheet_name = ns_parser.sheet_name[0] + sheet_name = getattr(ns_parser, "sheet_name", None) + if sheet_name and isinstance(sheet_name, list): + sheet_name = sheet_name[0] export_data( export_type=",".join(ns_parser.export),