Skip to content

Add $unwind stage tests#165

Open
alinaliBQ wants to merge 6 commits intodocumentdb:mainfrom
alinaliBQ:unwind
Open

Add $unwind stage tests#165
alinaliBQ wants to merge 6 commits intodocumentdb:mainfrom
alinaliBQ:unwind

Conversation

@alinaliBQ
Copy link
Copy Markdown

This change adds tests for the $unwind stage operator.

Add stage operator tests for $unwind. Tests database $unwind behavior, syntax, and expected errors.
Integration tests are in documentdb_tests/compatibility/tests/core/operator/stages/test_stages_position_unwind.py

@alinaliBQ alinaliBQ requested a review from a team as a code owner May 5, 2026 19:56
danielfrankcom and others added 2 commits May 5, 2026 12:56
Signed-off-by: Daniel Frankcom <frankcom@amazon.com>

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>

Fix error return value

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
init.py

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>

split into test cases

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>

Put lambda tests into StageTestCase

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>

split test cases

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>

add missing test cases

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>

remove duplicate test cases

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>

changes after rebase

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>

unwind integration tests

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>

Address feedback

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>

Address Feedback

Use long form consistently

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>

address feedfback

Remove transform

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>

address feedback

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
@documentdb-triage-tool documentdb-triage-tool Bot added compatibility test Compatibility test related enhancement New feature or request labels May 5, 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 XL · Status Needs Review
Confidence: 0.90 (mixed)

Reasoning

component from path globs (test-coverage, test-framework); effort from diff stats (3254+1 LOC, 20 files); LLM: Adds new integration test coverage for the $unwind aggregation stage operator, touching the compatibility tests path.

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.

Copy link
Copy Markdown
Collaborator

@danielfrankcom danielfrankcom left a comment

Choose a reason for hiding this comment

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

Looks good - just a couple of minor comments

alinaliBQ added 4 commits May 5, 2026 16:48
Merge Test files

group these files together:
-  test_unwind_errors_path_syntax.py + test_unwind_errors_preserve_and_fields.py
-   test_unwind_dotted_path.py + test_unwind_dotted_path_options.py
 -  test_unwind_include_array_index.py +  test_unwind_index_field_name_acceptance.py
- test_unwind_scalar_passthrough.py + test_unwind_unicode.py
-  test_unwind_mixed_shape.py + test_unwind_nested_arrays.py  + test_unwind_multi_stage.py

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
remove Javascript code
add non-existent collection tests
add ignore_doc_order=true to avoid flaky tests
put large array test to standalone

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
remove error precedence

Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Signed-off-by: Alina (Xi) Li <Alina.Li@improving.com>
Copy link
Copy Markdown
Author

@alinaliBQ alinaliBQ left a comment

Choose a reason for hiding this comment

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

Addressed comments from Daniel

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.

2 participants