Skip to content

Apply configured insertion rules in Box.update - #360

Merged
cdgriffith merged 2 commits into
cdgriffith:developfrom
peterolkhov:codex/update-configured-insertions
Nov 13, 2026
Merged

cdgriffith merged 2 commits into
cdgriffith:developfrom
peterolkhov:codex/update-configured-insertions

Conversation

@peterolkhov

Copy link
Copy Markdown
Contributor

Box.update bypasses the assignment boundary for ordinary keys. With box_recast={"batch_size": int}, updating batch_size to "12" stores a string; with camel_killer_box=True, updating TimeOut leaves both the old time_out value and a new TimeOut key. Union operators inherit the same behavior.

Route update insertions through __setitem__ so recasting, key conversion, duplicate checks and subclass assignment hooks match single-item assignment. Nested values still replace existing values, and dotted paths keep their existing routing.

The regression tests cover mapping/pair/keyword updates, unions, recast failures and call counts, camel key policies, duplicate policies, ConfigBox and subclass dispatch. The existing exact-key lookup test now constructs its raw-key collision explicitly; its assertions are unchanged.

Validation on macOS arm64, CPython 3.14.7:

  • New regressions: 14 fail and 2 controls pass before the fix; all 16 pass afterward.
  • Full pure-Python suite: 1,214 passed, 1 skipped; 100% line and branch coverage.
  • Full installed Cython wheel suite: 1,214 passed, 1 skipped; compiled module import verified.
  • Ruff 0.17.3 lint/format, mypy, sdist/wheel builds and twine check pass.

Other Python versions and CI platforms were not run locally. This change was prepared with OpenAI Codex.

@cdgriffith
cdgriffith merged commit 4085faa into cdgriffith:develop Nov 13, 2026
cdgriffith added a commit that referenced this pull request Nov 13, 2026
Apply configured insertion rules in Box.update

# Conflicts:
#	CHANGES.rst
@cdgriffith cdgriffith mentioned this pull request Nov 13, 2026
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.

2 participants