JECSand / yahoofinancials

A powerful financial data module used for pulling data from Yahoo Finance. This module can pull fundamental and technical data for stocks, indexes, currencies, cryptos, ETFs, Mutual Funds, U.S. Treasuries, and commodity futures.
https://pypi.python.org/pypi/yahoofinancials
MIT License
911 stars 215 forks source link

AssertionError running test_yahoofinancials.py (line 93) #11

Closed crendon8 closed 6 years ago

crendon8 commented 6 years ago

test_historical_price line failed the assertDictEqual(single_stock_prices['C']['prices'][0], expect_dict)

single_stock_prices['C']['prices'][0] = {date, high, low, open, close, volume, adjclose, formatted_date}

while.... expect_dict = {high, volume, formatted_date, low, adjclose, date, close, open}

JECSand commented 6 years ago

Hi Crendon,

Thank you for reporting this issue. I am looking into this issue now and will post a more detailed report within the next few days.

JECSand commented 6 years ago

Hi Crendon,

The issue revolved around timezones. The date string wasn't being transformed into an UTC Unix timestamp, but a local timezone Unix timestamp in the format_date function. This caused different historical price data values to be returned depending on the environments timezone. This has been fixed with the new v1.2 release.

Let me know if you have anymore issues.

Thanks!