问答详情
源自:7-5 开发 COVID-19 感染数据查询接口

get_data 这个方法 我查不到的时候 没有错 查到值得时候 就这样了

http://img4.mukewang.com/6231ad7400017a8713900973.jpg


Fatal Python error: Cannot recover from stack overflow.


Thread 0x000000030d348000 (most recent call first):


  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/fastapi/encoders.py", line 149 in jsonable_encoder

  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/fastapi/encoders.py", line 96 in jsonable_encoder

  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/fastapi/encoders.py", line 149 in jsonable_encoder

  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/fastapi/encoders.py", line 149 in jsonable_encoder

提问者:Jack2022 2022-03-16 17:28

个回答

  • qq_慕圣2233221
    2022-07-12 08:24:14

    # crud.py文件里有个错误 return db.query(models.Data).filter(models.Data.city.has(province=city)) '问题出现在这行代码,缺少了'.all() 。改为:return db.query(models.Data).filter(models.Data.city.has(province=city)).all()就可以了