DEV-1788: unify aggregated slot-type and display-format inference - #307
Conversation
aggregated_type and _infer_aggregated_format now share one classify_aggregation classifier (core/enums.py) returning a 4-bucket AggregationValueClass, so slot type and display format cannot drift. Behavioral (format only): avg/median/weighted_avg of a formatted measure inherit its format (was FLOAT); corr/var*/covar* -> FLOAT (were inherit); stddev*/percentile unchanged. aggregated_type unchanged.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 20 seconds Limit details: You’ve used all 3 included reviews currently available under your plan. You completed 41 included PR reviews in the past 7 days; at that activity level, included reviews refill at 3 reviews per hour. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
Included review availability: 0 reviews are currently available. Based on recent review activity, included reviews refill at 3 per hour. 📝 WalkthroughWalkthroughThe change adds a shared aggregation classifier. Prebound result types and response metadata formats now use four aggregation classes. Tests cover source-format inheritance, float fallbacks, custom aggregations, star counts, missing columns, and caller consistency. ChangesAggregation inference
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The PR unifies aggregated type and display-format inference with focused tests and no actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
…lidation-of-sql-generation-dev-1450' into egor/dev-1788-aggregated-slot-format-inference-diverges-from-slot-type-for # Conflicts: # DECISIONS.md
|
7f6e90d
into
egor/dev-1742-one-doctrine-consolidation-of-sql-generation-dev-1450



Follow-up to DEV-1784 (PR #286 review G2, item 8). Reconciles the two parallel inference functions that disagreed on stat/parametric aggregations.
Problem
aggregated_type(slotDataType) and_infer_aggregated_format(displayNumberFormat) diverged on the stat/parametric family: type saidDOUBLEwhile format fell through to inherit the source column's format, sorevenue:stddev_sampwas typedDOUBLEyet displayed as currency.Fix
Both functions now read a single
classify_aggregation(core/enums.py) returning one of fourAggregationValueClassbuckets; each maps the bucket to its own output, so no per-name branching survives and the two axes cannot drift. The four builtin frozensets partitionBUILTIN_AGGREGATIONS(pinned by a completeness test). Custom/model-defined aggregations hit thePRESERVINGfallback (inherit type & format), unchanged.COUNT*INTINTEGERPRESERVINGFLOAT_SOURCE_UNITSDOUBLEFLOATFLOAT_PLAINDOUBLEFLOATBehavioral change (format only;
aggregated_typeunchanged)FLOAT); of an unformatted measure stayFLOAT.FLOAT(were inherit).Tests
Drift-guard matrix extended to the full four-bucket set and routed through the public callers (
measure_key_type/measure_key_format_description); partition-completeness test; missing-source-column and custom-aggregation cases; response-metadata assertions for the stat/parametric family. Full non-integration suite green; ruff clean.Base: this PR targets the umbrella branch
egor/dev-1742-...per the issue, notmain.Summary by CodeRabbit
Improvements
Documentation