Skip to content

Add $geometry tests#220

Open
PatersonProjects wants to merge 8 commits into
documentdb:mainfrom
PatersonProjects:geometry_tests
Open

Add $geometry tests#220
PatersonProjects wants to merge 8 commits into
documentdb:mainfrom
PatersonProjects:geometry_tests

Conversation

@PatersonProjects
Copy link
Copy Markdown
Contributor

This PR adds the compatibility test for the $geometry geospatial specifier

Ref: Issue #32

…rity, removed out of scope cases

Signed-off-by: PatersonProjects <[email protected]>
Signed-off-by: PatersonProjects <[email protected]>
@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels May 20, 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 L · Status In Progress
Confidence: 0.82 (mixed)

Reasoning

component from path globs (test-coverage); effort from diff stats (1363+0 LOC, 7 files); LLM: Adds new compatibility test coverage for the $geometry geospatial specifier, expanding test-coverage under documentdb_tests/compatibility/tests.

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.

Signed-off-by: PatersonProjects <[email protected]>
@PatersonProjects PatersonProjects marked this pull request as ready for review May 22, 2026 18:46
@PatersonProjects PatersonProjects requested a review from a team as a code owner May 22, 2026 18:46
CCW_POLYGON = [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]]


INVALID_GEOMETRY_TESTS: list[QueryTestCase] = [
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: PR #218 ($near) has a test missing_type_defaults_to_point that asserts $geometry without type succeeds (defaults to Point) when used with $near. This test asserts it errors with $geoIntersects. Both pass against MongoDB, so the behavior differs by parent operator. Consider adding a brief comment here noting this is $geoIntersects-specific — $near allows missing type.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I think we're better off removing the case since there will be a test added in geoIntersects looking at #232, it being here leads one to think that's geometry behaviour when it's not.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed test case

Comment thread documentdb_tests/framework/error_codes.py Outdated
Signed-off-by: PatersonProjects <[email protected]>
@PatersonProjects PatersonProjects requested a review from fanyangv May 26, 2026 22:55
Copy link
Copy Markdown
Collaborator

@eerxuan eerxuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the test cases are testing $geometry's container like $geoWithin or $geoIntersects. Those are duplication. This folder should focus on $geometry input validation and GeoJson types. Just use one container in command ($geoIntersects"), don't use others.

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.

4 participants