Skip to content

Add $isNumber compatibility tests (#212)#653

Open
xMayble wants to merge 1 commit into
documentdb:mainfrom
xMayble:fix-issue-212
Open

Add $isNumber compatibility tests (#212)#653
xMayble wants to merge 1 commit into
documentdb:mainfrom
xMayble:fix-issue-212

Conversation

@xMayble

@xMayble xMayble commented Jun 29, 2026

Copy link
Copy Markdown

What does this PR do?

Adds compatibility test coverage for the $isNumber aggregation 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 $isNumber behavior is most easily mis-implemented across engines.

What are the relevant issue numbers?

Closes #212

Does this PR meet the acceptance criteria?

  • Tests added for new/changed behavior
  • Follows project style guide (black-formatted, tagged @pytest.mark.aggregate, uses pytest_params / BaseTestCase / execute_expression* helpers)
  • No breaking changes introduced (purely additive — new files only)
  • All tests passing (validated locally to compile/collect; relying on CI to run against MongoDB)

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>
@xMayble xMayble requested a review from a team as a code owner June 29, 2026 00:28
@xMayble

xMayble commented Jun 29, 2026

Copy link
Copy Markdown
Author

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!

@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels Jun 29, 2026
@documentdb-triage-tool

Copy link
Copy Markdown

🤖 Auto-triaged by documentdb-triage-tool.

Applied: compatibility test, enhancement
Project fields suggested: Component test-coverage · Priority P2 · Effort M · Status Needs Review
Confidence: 0.30 (deterministic)

Reasoning

component 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 @patty-chow so the rules can be tuned. The bot will not re-label items that already have component labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compatibility test Compatibility test related enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add compatibility test for $isNumber (second pass)

1 participant