Skip to content

Preserve iterable_compare_func rejections when building results - #679

Open
wozhenbang2004 wants to merge 2 commits into
qlustered:devfrom
wozhenbang2004:fix-rejected-iterable-pairs
Open

wozhenbang2004 wants to merge 2 commits into
qlustered:devfrom
wozhenbang2004:fix-rejected-iterable-pairs

Conversation

@wozhenbang2004

Copy link
Copy Markdown

Refs #307 (Cause 1).

The final same-path add/remove merge can turn records rejected by iterable_compare_func into values_changed. Preserve those explicit rejections through ordered and ignore-order matching, including cached pairs, while keeping the normal CannotCompare fallback.

For moved records, Delta applies same-path replacements at their source before moving the complete target value. It then avoids replaying redundant child additions and removals on the temporary move placeholder. The new Delta cases cover forward application with bidirectional=True and error checking enabled.

Added regressions for nested and moved parents, text/tree results, repetitions, mixed CannotCompare fallback, cache reuse, and Delta application. On Python 3.12.14:

  • The 14 focused cases pass; the same tests on unmodified dev have 5 failures and 9 passes.
  • pytest --benchmark-disable --cov=deepdiff --runslow -q tests/: 1,395 passed, 8 skipped, 95% coverage.
  • The CI syntax lint checks and uv build pass.

This is a partial fix for #307. It leaves the intersection cutoff unchanged. Separate compound nested-move and reverse-Delta failures reproduced on dev remain outside this change.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant