Repository navigation
refactor: share query stats rendering - #303
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 26 minutes and 8 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
298b151 to
fe19d91
Compare
01d4be0 to
a1260f3
Compare
a1260f3 to
6c0562d
Compare
## Summary - Adds shared grouped-stats table rendering for query stats surfaces. - Reuses common date/provider grouping helpers across summary, conversation, semantic, and profile-backed stats. - Preserves existing public function names and structured output payloads. ## Problem `polylogue/cli/query_stats.py` repeated the same group sorting, Rich table construction, total-row rendering, and semantic grouping loops across several stats paths. That made the surface harder to review and easy to drift when changing output contracts. ## Solution - Introduce typed internal helpers for grouped stats payloads, date/provider grouping keys, and table rendering. - Route summary/date/provider stats, in-memory grouped conversation stats, semantic action/tool stats, and profile-backed stats through the shared renderer. - Keep SQL archive stats and exported function names stable for existing call sites. Ref #270 ## Verification - `ruff format polylogue/cli/query_stats.py` - `ruff check polylogue/cli/query_stats.py` - `mypy polylogue/cli/query_stats.py tests/unit/cli/test_query_exec_laws.py` - `pytest -q tests/unit/cli/test_query_exec_laws.py -k 'stats'` - push hook: `devtools verify --quick`
`cli/query_stats.py` repeated the same group sorting, Rich table construction, total-row rendering, and semantic grouping loops across several stats paths. The surface was hard to review and easy to drift when changing output contracts. Introduces typed internal helpers for grouped stats payloads, date/provider grouping keys, and table rendering. Routes summary/ date/provider stats, in-memory grouped conversation stats, semantic action/tool stats, and profile-backed stats through the shared renderer. Keeps SQL archive stats and exported function names stable for existing call sites. Verification: ruff + mypy + pytest over query-exec-laws stats coverage; devtools verify --quick green. Ref #270
`cli/query_stats.py` repeated the same group sorting, Rich table construction, total-row rendering, and semantic grouping loops across several stats paths. The surface was hard to review and easy to drift when changing output contracts. Introduces typed internal helpers for grouped stats payloads, date/provider grouping keys, and table rendering. Routes summary/ date/provider stats, in-memory grouped conversation stats, semantic action/tool stats, and profile-backed stats through the shared renderer. Keeps SQL archive stats and exported function names stable for existing call sites. Verification: ruff + mypy + pytest over query-exec-laws stats coverage; devtools verify --quick green. Ref #270
`cli/query_stats.py` repeated the same group sorting, Rich table construction, total-row rendering, and semantic grouping loops across several stats paths. The surface was hard to review and easy to drift when changing output contracts. Introduces typed internal helpers for grouped stats payloads, date/provider grouping keys, and table rendering. Routes summary/ date/provider stats, in-memory grouped conversation stats, semantic action/tool stats, and profile-backed stats through the shared renderer. Keeps SQL archive stats and exported function names stable for existing call sites. Verification: ruff + mypy + pytest over query-exec-laws stats coverage; devtools verify --quick green. Ref #270
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Problem
polylogue/cli/query_stats.pyrepeated the same group sorting, Rich table construction, total-row rendering, and semantic grouping loops across several stats paths. That made the surface harder to review and easy to drift when changing output contracts.Solution
Ref #270
Verification
ruff format polylogue/cli/query_stats.pyruff check polylogue/cli/query_stats.pymypy polylogue/cli/query_stats.py tests/unit/cli/test_query_exec_laws.pypytest -q tests/unit/cli/test_query_exec_laws.py -k 'stats'devtools verify --quick