Skip to content

Add abs expression tests#659

Open
danielfrankcom wants to merge 4 commits into
documentdb:mainfrom
danielfrankcom:pr/abs
Open

Add abs expression tests#659
danielfrankcom wants to merge 4 commits into
documentdb:mainfrom
danielfrankcom:pr/abs

Conversation

@danielfrankcom

Copy link
Copy Markdown
Collaborator

This change adds tests for the abs expression. It was originally authored by @vic-tsang.

Closes #272

Co-authored-by: Victor Tsang <vitsangp@amazon.com>
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
@danielfrankcom danielfrankcom requested a review from a team as a code owner June 30, 2026 01:43
@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 Needs Review
Confidence: 0.30 (deterministic)

Reasoning

component from path globs (test-coverage); effort from diff stats (724+0 LOC, 7 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.

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

Copy link
Copy Markdown
Contributor

I think we should probably add in docStrings for these files

Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
@danielfrankcom

Copy link
Copy Markdown
Collaborator Author

I think we should probably add in docStrings for these files

Assuming you mean module docstrings here, since there are already docstrings for the property groups. Just pushed a change with those, please let me know if you meant something else.

@PatersonProjects

Copy link
Copy Markdown
Contributor

I think we should probably add in docStrings for these files

Assuming you mean module docstrings here, since there are already docstrings for the property groups. Just pushed a change with those, please let me know if you meant something else.

That is what I meant! Sorry should've been clearer

@PatersonProjects PatersonProjects left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks good to me, but you may want to consider adding a nested field path test?
{"a": [{"b": -1}, {"b": -2}]}, expression {"$abs": "$a.b"}

Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
@ramgokul-14

Copy link
Copy Markdown

Signed-off-by: Daniel Frankcom <frankcom@amazon.com>
@danielfrankcom

Copy link
Copy Markdown
Collaborator Author

Are tests in other contexts per https://github.com/documentdb/functional-tests/blob/main/docs/testing/TEST_COVERAGE.md#11-expression-operator-in-pipeline-contexts in scope for this change?

I think this is out of scope for expression-level changes, it falls within the scope of integration tests for the consuming aspects, like stages/project/test_project_expressions.py for example.

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 $abs

3 participants