Add $isNumber compatibility tests (#212)#653
Conversation
Add compatibility test coverage for the $isNumber aggregation expression operator, covering numeric BSON types (int32, int64, double, Decimal128 — including NaN/Infinity/negative zero), non-numeric BSON types, and null/missing field inputs. Each case is exercised both as a literal expression and via a document field reference. Signed-off-by: Mehbub Rohit <mehbubrohit12@gmail.com>
|
Hey, this is my first contribution to the project. This PR addresses #212 by adding $isNumber compatibility coverage across numeric types, non-numeric types, and null/missing inputs. Would appreciate a review when you have time. Thanks! |
|
🤖 Auto-triaged by documentdb-triage-tool. Applied: Reasoningcomponent from path globs (test-coverage); effort from diff stats (321+0 LOC, 3 files); LLM failed: Invalid response body while trying to fetch https://api.anthropic.com/v1/messages: Premature close If a label is wrong, remove it manually and ping |
What does this PR do?
Adds compatibility test coverage for the
$isNumberaggregation expression operator. Three new test files exercise the operator against numeric BSON types (int32, int64, double, and Decimal128 — including the NaN, Infinity, and negative-zero edge cases), non-numeric BSON types (string, bool, array, object, ObjectId, Date, Timestamp, Binary, Regex, MinKey/MaxKey, Code), and null/missing field inputs. Every case is run both as a literal expression and via a document field reference.Why was this PR needed?
Issue #212 requests a second-pass compatibility test for
$isNumber. Only a single smoke test (test_smoke_isNumber.py) existed; there was no systematic coverage of the numeric-vs-non-numeric type boundary or of null/missing inputs, which is where$isNumberbehavior is most easily mis-implemented across engines.What are the relevant issue numbers?
Closes #212
Does this PR meet the acceptance criteria?
@pytest.mark.aggregate, usespytest_params/BaseTestCase/execute_expression*helpers)