Skip to content

Commit

Permalink
proper handling of sheet name
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoaquim committed May 14, 2024
1 parent 7cef440 commit 45bfac2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions cli/openbb_cli/controllers/base_platform_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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),
Expand Down

0 comments on commit 45bfac2

Please sign in to comment.