feat: batch query string array params to avoid URL length limits#274
Conversation
When list parameters (datapoint_ids, run_ids) exceed 100 items, the client now transparently splits requests into batches and merges the results. This avoids hitting URL length limits (8-16 KB) and the backend's qs arrayLimit of 1000. Affected methods: - DatapointsAPI.list() / list_async() - ExperimentsAPI.list_runs() / list_runs_async() ✨ Created with Claude Code
|
Claude finished @skylarmb's task in 2m 10s —— View job Review complete. Posted 6 inline comments and a top-level summary.
Key findings:
|
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
📚 Documentation preview built — Download artifact Review instructions & validation statusHow to Review
Validation Status
|
Review SummaryGood approach — transparently batching large query-string arrays is the right call for avoiding URL length limits. The implementation is clean, well-tested, and the API surface is unchanged. A few things worth addressing before merge: Should fix:
Worth considering:
Nits:
Tests look solid — good coverage of boundary conditions, passthrough, batching + merge, metric deduplication, and async variants. |
- Parallelize async batch requests with asyncio.gather() - Strip page/limit params from batched run requests - Fix total_unfiltered aggregation to use per-batch values - Add error context logging before re-raising batch failures - Use generic TypeVar for _chunk_list type hint - Move Pagination import to module level ✨ Created with Claude Code
|
📚 Documentation preview built — Download artifact Review instructions & validation statusHow to Review
Validation Status
|
✨ Created with Claude Code
|
@claude review if feedback has been adequately addressed |
|
Claude finished @skylarmb's task in 1m 43s —— View job All previous review feedback has been adequately addressed in
Feedback status
One minor remaining nit: there's only one blank line between LGTM — the fix commit cleanly addresses every point raised in the initial review. |
|
📚 Documentation preview built — Download artifact Review instructions & validation statusHow to Review
Validation Status
|
✨ Created with Claude Code
|
📚 Documentation preview built — Download artifact Review instructions & validation statusHow to Review
Validation Status
|
Summary
datapoint_ids,run_ids) exceed 100 items, the client now transparently splits requests into batches and merges resultsqsarrayLimitof 1000Changes
src/honeyhive/api/client.py— addedQUERY_BATCH_SIZE,_chunk_list()helper, and batching logic inDatapointsAPI.list()/list_async()andExperimentsAPI.list_runs()/list_runs_async()tests/unit/test_api_query_batching.py— 14 unit tests covering chunk logic, passthrough for small lists, batching + merge for large lists, metric deduplication, and async variantsTest plan
pytest tests/unit/test_api_query_batching.py— 14/14 passtest_api_events_fixes.py— 20/20 pass)🔗 Related backend PR: https://github.com/honeyhiveai/hive-kube/pull/2430
✨ Created with Claude Code