Skip to content

[Bug] SZSE trading calendar fetch failed for years 2000-2004 in data_collector/utils.py #2088

@touhoufan2024

Description

@touhoufan2024

Description:

I encountered a JSONDecodeError when running the data collector script to initialize CN data. After debugging, I found that the _get_calendar_from_month function in qlib/scripts/data_collector/utils.py fails to retrieve trading calendar data from the Shenzhen Stock Exchange (SZSE) API for the years 2000 to 2004.
It seems the SZSE official API no longer returns valid data for these historical dates, while data from 2005 onwards works fine.

To Reproduce:

Run the data collector script that triggers get_calendar_list("ALL").
The script calls _get_calendar_from_month for historical months.
The process crashes when requesting data for months between 2000 and 2004.
Evidence / API Analysis:
I verified the specific API endpoints used by the collector:
❌ Failed Request (Year 2004):
URL: https://www.szse.cn/api/report/exchange/onepersistenthour/monthList?month=2004-01
Result: Returns invalid data (or empty response), causing JSONDecodeError.
✅ Successful Request (Year 2005):
URL: https://www.szse.cn/api/report/exchange/onepersistenthour/monthList?month=2005-01
Result: Returns valid JSON data properly.

Image

log

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions