Discrepancy using max_periods for TSLA
When using the newly released max_periods option it seems that TSLA returns max_periods-1 instead of max_periods specifically for 10-K forms.
The code below:
ticker = 'TSLA'
cc = Company(ticker)
ff = cc.get_filings(form="10-K", year=[2025, 2024, 2023, 2022])
xx = XBRLS.from_filings(ff)
bb = xx.statements.balance_sheet(max_periods=3)
ii = xx.statements.income_statement(max_periods=3)
cc = xx.statements.cashflow_statement(max_periods=3)
... returns only two years, instead of three years of annual data:
The same behaviour is seen for the income statement and cashflow statement also.
But when running this code with many other companies (MSFT example below), the correct number of max_periods annual data is returned.
I just found an issue yesterday when running tests against TSLA. Sometimes amended filings ie 10-K/A don't have all the statements. So TSLA filed an amended statement with just the CoverPage and no IncomeStatement, BalanceSheet of CashFlow
ff = cc.get_filings(form="10-K", year=[2025, 2024, 2023, 2022], amendments=False)
I will have to update the documentation.
Now it's possible the 10-K/A includes actual statements and this is what we will want, so will have to think about this
Now it's possible the 10-K/A includes actual statements and this is what we will want, so will have to think about this
Thanks Dwight for catching this so quickly. I agree that for some people having the most up-to-date information might be important, but for our needs just having the historical 10-K and 10-Q figures is sufficient for us. Once the next quarter rolls around then the figures should have been updated from whichever intervening /A form was submitted.
The amendment=false option helps solve this issue. Thanks so much!