Back to Community
JSONDecodeError while loading custom bundle data

I have been using zipline in local development since March this year. I can load my custom data bundle till early June fine.

After I came back from a long trip, I found out the unit test failed with following error:

Traceback (most recent call last):  
  File "/Users/mintu/anaconda3/envs/q/lib/python3.6/unittest/", line 59, in testPartExecutor  
  File "/Users/mintu/anaconda3/envs/q/lib/python3.6/unittest/", line 605, in run  
  File "/Users/mintu/PycharmProjects/myZipline/myzipline/tests/", line 138, in test_zigzag_trends_2014  
  File "/Users/mintu/anaconda3/envs/q/lib/python3.6/site-packages/zipline/utils/", line 430, in run_algorithm  
  File "/Users/mintu/anaconda3/envs/q/lib/python3.6/site-packages/zipline/utils/", line 159, in _run  
  File "/Users/mintu/anaconda3/envs/q/lib/python3.6/site-packages/zipline/finance/", line 103, in __init__  
  File "/Users/mintu/anaconda3/envs/q/lib/python3.6/site-packages/zipline/data/", line 149, in load_market_data  
  File "/Users/mintu/anaconda3/envs/q/lib/python3.6/site-packages/zipline/data/", line 216, in ensure_benchmark_data  
    data = get_benchmark_returns(symbol)  
  File "/Users/mintu/anaconda3/envs/q/lib/python3.6/site-packages/zipline/data/", line 35, in get_benchmark_returns  
    data = r.json()  
  File "/Users/mintu/anaconda3/envs/q/lib/python3.6/site-packages/requests/", line 897, in json  
    return complexjson.loads(self.text, **kwargs)  
  File "/Users/mintu/anaconda3/envs/q/lib/python3.6/json/", line 354, in loads  
    return _default_decoder.decode(s)  
  File "/Users/mintu/anaconda3/envs/q/lib/python3.6/json/", line 339, in decode  
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())  
  File "/Users/mintu/anaconda3/envs/q/lib/python3.6/json/", line 357, in raw_decode  
    raise JSONDecodeError("Expecting value", s, err.value) from None  
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

after some debug, seems like the error come from loading 5 years ago data

    start = pd.Timestamp(datetime(2014, 6, 9, tzinfo=pytz.UTC))  
    end = pd.Timestamp(datetime(2014, 6, 10, tzinfo=pytz.UTC))

Any suggestions?

Thanks in advance

1 response

SPY IEX data is gone...
Check out:
for some fixes.