zvtvz / zvt

modular quant framework.
https://zvt.readthedocs.io/en/latest/
MIT License
3.22k stars 860 forks source link

更新东方财富时报这个错误,请问怎么解决? #77

Closed markqiu closed 4 years ago

markqiu commented 4 years ago

更新东方财富时报这个错误,请问怎么解决?

2020-07-02 15:29:45,843  INFO  MainThread  run to 2213/3758
2020-07-02 15:29:46,014  INFO  MainThread  entity_id:stock_sz_300813,evaluate_start_end_size_timestamps result:None,None,2,None
2020-07-02 15:29:46,014  INFO  MainThread  sleeping 5 seconds
2020-07-02 15:30:01,188  ERROR  MainThread  code:200,content:�V
J-.�)Q��+���Q
.I,)-V��5400�Q�M-.NLOU�Rz�������>�_�bC��)+�.��b�R%%����"ϼ�|%�j�J����J�f90�@l�ĒD
                                                                               ������\=���������b=�ԼԢ�d=�L�@bQe�Q4T]pIQf^�
/V�����_�
Traceback (most recent call last):
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/recorders/eastmoney/common.py", line 75, in call_eastmoney_api
    origin_result = resp.json().get('Result')
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/requests-2.24.0-py3.7.egg/requests/models.py", line 898, in json
    return complexjson.loads(self.text, **kwargs)
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/simplejson-3.16.0-py3.7-linux-x86_64.egg/simplejson/__init__.py", line 518, in loads
    return _default_decoder.decode(s)
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/simplejson-3.16.0-py3.7-linux-x86_64.egg/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/simplejson-3.16.0-py3.7-linux-x86_64.egg/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2020-07-02 15:30:01,190  ERROR  MainThread  recording data for entity_id:stock_sz_300813,<class 'zvt.domain.fundamental.dividend_financing.DividendFinancing'>,error:Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/contract/recorder.py", line 400, in run
    timestamps=timestamps)
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/recorders/eastmoney/common.py", line 136, in record
    path_fields=self.path_fields)
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/recorders/eastmoney/common.py", line 104, in request
    return call_eastmoney_api(url=url, method=method, param=param, path_fields=path_fields)
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/recorders/eastmoney/common.py", line 78, in call_eastmoney_api
    raise e
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/recorders/eastmoney/common.py", line 75, in call_eastmoney_api
    origin_result = resp.json().get('Result')
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/requests-2.24.0-py3.7.egg/requests/models.py", line 898, in json
    return complexjson.loads(self.text, **kwargs)
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/simplejson-3.16.0-py3.7-linux-x86_64.egg/simplejson/__init__.py", line 518, in loads
    return _default_decoder.decode(s)
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/simplejson-3.16.0-py3.7-linux-x86_64.egg/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/simplejson-3.16.0-py3.7-linux-x86_64.egg/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2020-07-02 15:30:22,182  ERROR  MainThread  eastmoney runner2 error:Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "examples/recorders/eastmoney_data_runner2.py", line 24, in run
    DividendFinancing.record_data(provider='eastmoney')
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/contract/schema.py", line 152, in record_data
    r.run()
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/contract/recorder.py", line 481, in run
    raise raising_exception
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/contract/recorder.py", line 400, in run
    timestamps=timestamps)
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/recorders/eastmoney/common.py", line 136, in record
    path_fields=self.path_fields)
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/recorders/eastmoney/common.py", line 104, in request
    return call_eastmoney_api(url=url, method=method, param=param, path_fields=path_fields)
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/recorders/eastmoney/common.py", line 78, in call_eastmoney_api
    raise e
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/zvt/recorders/eastmoney/common.py", line 75, in call_eastmoney_api
    origin_result = resp.json().get('Result')
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/requests-2.24.0-py3.7.egg/requests/models.py", line 898, in json
    return complexjson.loads(self.text, **kwargs)
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/simplejson-3.16.0-py3.7-linux-x86_64.egg/simplejson/__init__.py", line 518, in loads
    return _default_decoder.decode(s)
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/simplejson-3.16.0-py3.7-linux-x86_64.egg/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/home/markqiu/.pyenv/versions/3.7.7/lib/python3.7/site-packages/simplejson-3.16.0-py3.7-linux-x86_64.egg/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
foolcage commented 4 years ago

确认是stock_sz_300813特殊问题?还是某时间段东财服务不可用?看起来是乱码。

markqiu commented 4 years ago

确认时特殊问题,我反复执行几次都是在这里报错。 @foolcage

doncat99 commented 4 years ago

BalanceSheet.record_data()的時候就會出錯。看了一下,rasie e了。這塊更新邏輯不走增量更新,每次都是全量。

foolcage commented 4 years ago

@doncat99 你跑的examples里面的脚本吧,脚本里的逻辑是如果出错,就会重新跑,但是每一个标的还是增量更新的。 raise e需要看具体的原因,如果是某些标的需要特殊处理,可以修一下。 你可以贴一下具体的错误。