There is no filter to validate the excel file used as portfolio data. Then, several errors may appear when opening files with incorrect format.
To Reproduce
Steps to reproduce the behavior:
Open the application from "main.py"
Click on 'Arquivo -> Abrir'
Open the target file
See error:
Traceback (most recent call last):
File "d:\Dudu\Finanþas\Investimentos\Mercado Financeiro\Investment_Portfolio_Analysis\main.py", line 103, in _openFile
self.PortfolioViewerWidget.updateData(file_name)
File "d:\Dudu\Finanþas\Investimentos\Mercado Financeiro\Investment_Portfolio_Analysis\portfolio_lib\portfolio_widget.py", line 243, in updateData
self.porfolio_investment = PorfolioInvestment(file_name)
File "d:\Dudu\Finanþas\Investimentos\Mercado Financeiro\Investment_Portfolio_Analysis\portfolio_lib\portfolio_investment.py",
line 27, in __init__
self.numberOperationsYear()
File "d:\Dudu\Finanþas\Investimentos\Mercado Financeiro\Investment_Portfolio_Analysis\portfolio_lib\portfolio_investment.py",
line 57, in numberOperationsYear
firstYear = dataframe[
File "C:\Users\Carlos\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\frame.py", line 3024, in __getitem__
indexer = self.columns.get_loc(key)
File "C:\Users\Carlos\AppData\Local\Programs\Python\Python39\lib\site-packages\pandas\core\indexes\base.py", line 3082, in get_loc
raise KeyError(key) from err
KeyError: 'Data'
Expected behavior
A message box shall be displayed in order to warn the user about the incorrect spreadsheet format
Screenshots
N/A
Desktop (please complete the following information):
Describe the bug
There is no filter to validate the excel file used as portfolio data. Then, several errors may appear when opening files with incorrect format.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A message box shall be displayed in order to warn the user about the incorrect spreadsheet format
Screenshots
N/A
Desktop (please complete the following information):
N/A
Additional context
N/A