summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrique Joaquim <henriquecjoaquim@gmail.com>2024-05-01 18:52:13 +0100
committerGitHub <noreply@github.com>2024-05-01 17:52:13 +0000
commit9a02e501f8f4ba2dc608e4824dc46d90898fc260 (patch)
tree869c4e1ec6bfd10d3a50efa717070e0e7a5e9da9
parente37c0c0a4024de9a9f79c7edefcabbd3145bfe87 (diff)
create a title out of the route being used to use it as table title (#6356)
-rw-r--r--cli/openbb_cli/controllers/base_platform_controller.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/openbb_cli/controllers/base_platform_controller.py b/cli/openbb_cli/controllers/base_platform_controller.py
index 50476a68460..c6b7d6b0374 100644
--- a/cli/openbb_cli/controllers/base_platform_controller.py
+++ b/cli/openbb_cli/controllers/base_platform_controller.py
@@ -154,6 +154,7 @@ class PlatformController(BaseController):
obbject = translator.execute_func(parsed_args=ns_parser)
df: pd.DataFrame = None
fig: OpenBBFigure = None
+ title = f"{self.PATH}{translator.func.__name__}"
if obbject:
Registry.register(obbject)
@@ -172,11 +173,11 @@ class PlatformController(BaseController):
df = obbject.to_dataframe()
if isinstance(df.columns, pd.RangeIndex):
df.columns = [str(i) for i in df.columns]
- print_rich_table(df, show_index=True)
+ print_rich_table(df=df, show_index=True, title=title)
elif isinstance(obbject, dict):
df = pd.DataFrame.from_dict(obbject, orient="index")
- print_rich_table(df, show_index=True)
+ print_rich_table(df=df, show_index=True, title=title)
elif obbject:
Session().console.print(obbject)