Closed cmpunches closed 9 months ago
This should probably be closed unless pandas_datareader is receptive to doing some workaround things to suppress yfinance output to stderr and check for return sizes and similar to handle its behaviour. This is a bug in yfinance and has been filed over there:
This issue seems to be pervasive through the library but can be demonstrated with the below:
It'll produce the following:
The error output is printed to STDERR instead of throwing an exception for the application consuming the library to handle.
This means that the library currently hijacks STDERR for consuming applications to report errors instead of leaving the control over how errors are handled and represented by the consuming application. A library should never write to stdout and stderr unless its functions are specifically to handle writing to those and the consuming application called those functions to create that behaviour.
This also has very big implications for flow control and error detection in consuming logic.