feat: get_fin_details_range のキャッシュを CSV.gz から parquet に変更#6
Merged
Conversation
CSV は dict を repr 文字列として保存するため読み出し時にパースが必要だった。 parquet は dict を map 型として保持するため FS 列が常に dict で復元される。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
forループでの逐次 pd.read_csv / pd.read_parquet がイベントループをブロックし、 全履歴(6000超ファイル)取得時に著しく遅くなる問題を修正。 asyncio.to_thread + asyncio.gather でキャッシュファイルを並列読み込みするよう変更。 合わせて pyarrow を依存関係に追加し、テストの csv.gz → parquet 形式不一致も修正。 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
get_fin_details_rangeのキャッシュ保存形式を CSV.gz から parquet に変更する。利用側(
japanese_stock_ml_system)は本パッケージを editable install で参照しているが、この parquet 化コミット(5f4d605)がorigin/mainに未反映だった。別環境でuv syncした際にキャッシュ形式が食い違うのを防ぐため、main に取り込む。含まれるコミット
5f4d605feat: get_fin_details_range のキャッシュを CSV.gz から parquet に変更 ← 本PRの主眼c892aedperf: get_fin_summary_range / get_fin_details_range のキャッシュ読み込みを並列化注記
並列化(
c892aed)は既に #5(7e09edf)として main にマージ済みの内容です。本ブランチでは parquet 化の上に並列化を積んだ整合済みの状態になっています。マージ時に競合が出ないかご確認ください。変更ファイル
src/async_jquants_api_client/client.py: キャッシュ読み書きを parquet 化pyproject.toml/uv.lock: parquet 依存追加tests/test_client.py: テスト更新🤖 Generated with Claude Code