Skip to content

fix: serialize trading history query data#8

Open
willzhqiang wants to merge 1 commit into
atompilot:mainfrom
willzhqiang:codex/fix-history-query-data
Open

fix: serialize trading history query data#8
willzhqiang wants to merge 1 commit into
atompilot:mainfrom
willzhqiang:codex/fix-history-query-data

Conversation

@willzhqiang

Copy link
Copy Markdown

Summary

  • serialize pandas/numpy values returned by trading history query/export APIs into JSON-safe values
  • accept dict user_param for query_data/export_data while keeping legacy empty string compatibility
  • add focused regression tests for DataFrame serialization and user_param normalization

Why

The trading history query/export endpoints can return pandas objects or require user_param to be passed as a dict to xtquant. Before this change, those responses could fail JSON serialization or pass an empty string where the underlying API expects a mapping.

Notes

This partially overlaps with #7 at the generic DataFrame serialization layer, but the scope here is trading query/export behavior plus user_param compatibility. If #7 lands first, this branch can be rebased and the shared helper changes adjusted.

Validation

  • uv run --extra server --with pytest pytest -q tests/test_history_export.py
  • 3 passed

@willzhqiang willzhqiang marked this pull request as ready for review June 12, 2026 02:44
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