halessi/DCF

Invalid date

Opened this issue · 0 comments

Date cannot be handled in data.py:get_historical_share_prices sometimes. The dates can be handled well if they are in the format YYYY-MM-DD, but sometimes the API gives us YYYY-MM and this causes an exception. I changed the file to give more output:

Error parsing '2016-12' to date.
Traceback (most recent call last):
  File "/home/timo/DCF/modeling/data.py", line 152, in get_historical_share_prices
    try: date_start, date_end = date[0:8] + str(int(date[8:]) - 2), date
ValueError: invalid literal for int() with base 10: ''

I have committed a change that surround it by try and except: continue so that it does display the plot but some values are missing. Parsing has to be implemented.