Add $bucketAuto aggregation stage compatibility tests#675
Conversation
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage, test-framework); effort from diff stats (2139+0 LOC, 12 files); LLM: Adds 141 new compatibility test cases across 10 files covering the $bucketAuto aggregation stage, plus framework-level additions to error_codes.py and test_constants.py, touching multiple files across the test-coverage component. If a label is wrong, remove it manually and ping |
Add compatibility test coverage for the $bucketAuto aggregation stage across core distribution semantics, boundary/type preservation, buckets and groupBy validation, granularity series, output specification, output and accumulator error propagation, and multi-stage interactions. Framework additions: - error_codes.py: $bucketAuto error-code constants (40239-40246, 40257-40261) - test_constants.py: GRANULARITY_VALUES preferred-number series Signed-off-by: Aaron Gong <jingyaog@amazon.com>
09611aa to
f813fbf
Compare
| DECIMAL128_JUST_BELOW_HALF = Decimal128("0.4999999999999999999999999999999999") | ||
| DECIMAL128_JUST_ABOVE_HALF = Decimal128("0.5000000000000000000000000000000001") | ||
|
|
||
| # $bucketAuto granularity preferred-number series values |
There was a problem hiding this comment.
bucketAuto specific, put under /bucketAuto/utils/
Feature being tested
The
$bucketAutoaggregation stage — automatic bucketing of documents into aspecified number of buckets based on a
groupByexpression, with even documentdistribution, boundary/type preservation, optional preferred-number
granularityseries, and per-bucket
outputaccumulators.Test cases
139 test cases across 10 files:
bucketAuto/test_bucketAuto_core_semantics.pybucketAuto/test_bucketAuto_boundaries.pybucketAuto/test_bucketAuto_buckets_validation.pybucketsaccepts int32/int64/whole-double/whole-Decimal128/1; rejects 0/negative/fractional/NaN/Infinity/overflow/non-numeric typesbucketAuto/test_bucketAuto_groupby.pygroupByexpression types, null/missing groupingbucketAuto/test_bucketAuto_arg_errors.pybucketAuto/test_bucketAuto_granularity.pybucketAuto/test_bucketAuto_output.py{$sum:1}, empty output, multiple accumulators, input-vs-sibling refs, nested expressions,$pushwith$$ROOT/$$CURRENT/$$REMOVE, special/duplicate field namesbucketAuto/test_bucketAuto_output_errors.py$-prefix, dotted names, non-accumulator valuesbucketAuto/test_bucketAuto_accumulator_errors.pystages/test_stages_position_bucketAuto.pystages/folder per FOLDER_STRUCTURE.mdFramework additions:
error_codes.py—$bucketAutoerror-code constants (40239–40246, 40257–40261)test_constants.py—GRANULARITY_VALUESpreferred-number series listMongoDB 8.2 documentation
output)TEST_COVERAGE.md guideline updates
None. No changes to
TEST_COVERAGE.mdwere required — the existing §15 (pipelinestages) and §18 (accumulators, which already names
$bucketAuto) already scope thisfeature. The new error-code constants and
GRANULARITY_VALUESare additive frameworksupport and did not warrant new rule text.