Skip to content

fix: handle empty paginated data#7296

Open
chaochaoweb3 wants to merge 1 commit into
akfamily:mainfrom
chaochaoweb3:codex/fix-empty-paginated-data
Open

fix: handle empty paginated data#7296
chaochaoweb3 wants to merge 1 commit into
akfamily:mainfrom
chaochaoweb3:codex/fix-empty-paginated-data

Conversation

@chaochaoweb3

Copy link
Copy Markdown

Summary

  • return an empty DataFrame when the first paginated response contains no records
  • avoid dividing by zero when data.diff is empty
  • add an offline regression test for the empty-result response shape

Verification

  • RED: .venv/bin/python -m pytest tests/test_utils_func.py -q failed with ZeroDivisionError: division by zero
  • GREEN: .venv/bin/python -m pytest tests/test_utils_func.py tests/test_func.py -q passed, 3 tests
  • .venv/bin/python -m py_compile akshare/utils/func.py tests/test_utils_func.py tests/test_func.py passed
  • git diff --check passed

Note: I used a local .venv with project dependencies for verification; generated environment/cache files are ignored and not included.

@chaochaoweb3 chaochaoweb3 marked this pull request as ready for review June 3, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant