Added error handling to check correspondence of fiscal dates in balance sheet and income statement (#5147)

This commit is contained in:
Bim Phomthong
2023-06-16 15:26:23 +02:00
committed by GitHub
parent ae452852d7
commit de45a661c3

View File

@@ -740,6 +740,12 @@ def get_dupont(symbol: str) -> pd.DataFrame:
)
return pd.DataFrame()
if not df_bs.index.equals(df_is.index):
console.print(
"The fiscal dates in the balance sheet do not correspond to the fiscal dates in the income statement."
)
return pd.DataFrame()
# pylint: disable=no-member
df_bs = df_bs.set_index("fiscalDateEnding")
df_is = df_is.set_index("fiscalDateEnding")