Skip to content

Documentation for Tickers.{history,download}() does not match function signature #2707

@pjmcdermott

Description

@pjmcdermott

Describe bug

The documentation at yfiance.Ticker documentation states that the default for the 'period' parameter for these methods is None.

The actual signature from at least yfinance==0.2.66 is that the default for the period parameter is '1mo'.

There appears to be some recent change around 0.2.66 whereby yfinance is now throwing an error "ValueError: Setting period, start and end is nonsense. Set maximum 2 of them." which draws attention to this discrepancy.

Moreover, as a matter of style I believe it would be better to through an error about "too many parameters" directly at the user entry point, Tickers.{download,history}.

I would also note that the default 'period' parameter for PirceHistory.history() is different from Tickers.{download,history}().

Simple code that reproduces your problem

n/a

Debug log with debug logging enabled

n/a

Bad data proof

No response

yfinance version

0.2.66

Python version

Python 3.12.3

Operating system

Linux larkfield 6.17.0-14-generic #14~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Jan 15 15:52:10 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions