From adcaadf261ce903193a735f019f0a4704af0d7a2 Mon Sep 17 00:00:00 2001 From: OpenBB Date: Sat, 22 Jul 2023 09:22:46 -0700 Subject: [PATCH] rename 1Year column to fix returning as 1970-01-01 --- openbb_terminal/economy/finviz_view.py | 11 ++++++++++- .../test_display_performance[False].txt | 2 +- .../test_display_performance[True].txt | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/openbb_terminal/economy/finviz_view.py b/openbb_terminal/economy/finviz_view.py index b39af3b5d80..4d913b2dea0 100644 --- a/openbb_terminal/economy/finviz_view.py +++ b/openbb_terminal/economy/finviz_view.py @@ -91,7 +91,16 @@ def display_performance( Export data to csv,json,xlsx or png,jpg,pdf,svg file """ df_group = finviz_model.get_performance_data(group, sortby, ascend) - df_group = df_group.rename(columns={"Name": ""}) + df_group = df_group.rename( + columns={ + "Name": "", + "Week": "1W", + "Month": "1M", + "3Month": "3M", + "6Month": "6M", + "1Year": "1Y", + } + ) if df_group.empty: return print_rich_table( diff --git a/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[False].txt b/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[False].txt index 4d3bca4aa90..c5e93bbbce3 100644 --- a/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[False].txt +++ b/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[False].txt @@ -1,4 +1,4 @@ - Week Month 3Month 6Month 1Year YTD Recom AvgVolume RelVolume Change Volume + 1W 1M 3M 6M 1Y YTD Recom AvgVolume RelVolume Change Volume 0 Basic Materials 0.0303 0.0337 0.0721 0.1212 0.1058 0.0419 2.21 5.643900e+08 1.70 0.0070 9.613600e+08 1 Communication Services 0.0637 -0.0258 -0.1031 -0.1558 -0.0248 -0.1145 1.88 7.649600e+08 1.78 0.0169 1.360000e+09 2 Consumer Cyclical 0.1093 -0.0505 -0.0915 -0.1022 -0.0962 -0.1226 2.06 1.340000e+09 1.78 0.0256 2.390000e+09 diff --git a/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[True].txt b/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[True].txt index 4d3bca4aa90..c5e93bbbce3 100644 --- a/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[True].txt +++ b/tests/openbb_terminal/economy/txt/test_finviz_view/test_display_performance[True].txt @@ -1,4 +1,4 @@ - Week Month 3Month 6Month 1Year YTD Recom AvgVolume RelVolume Change Volume + 1W 1M 3M 6M 1Y YTD Recom AvgVolume RelVolume Change Volume 0 Basic Materials 0.0303 0.0337 0.0721 0.1212 0.1058 0.0419 2.21 5.643900e+08 1.70 0.0070 9.613600e+08 1 Communication Services 0.0637 -0.0258 -0.1031 -0.1558 -0.0248 -0.1145 1.88 7.649600e+08 1.78 0.0169 1.360000e+09 2 Consumer Cyclical 0.1093 -0.0505 -0.0915 -0.1022 -0.0962 -0.1226 2.06 1.340000e+09 1.78 0.0256 2.390000e+09