Repository navigation
RowCore GC support, weak subclass cache, docs fixes (r5 F4, F16, F18) - #19
Open
dominikpeter wants to merge 1 commit into
Open
dominikpeter wants to merge 1 commit into
dominikpeter wants to merge 1 commit into
Conversation
…(r5 F4, F16, F18) Co-Authored-By: Claude <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
F4 - verified, fixed
RowCore held five Py fields with no traverse/clear; a row referenced from its own values/cursor/maps was never collected (weakref stayed alive after gc.collect()). Fix: traverse visits all five fields, clear replaces them with None. Added to the existing #[pymethods] block (no multiple-pymethods feature). PyO3 already visits the instance dict; the cfg-guarded _PyObject_GenericGetAttrWithDict code is untouched. Test: tests/common_issues/test_rowcore_gc.py (failed before, passes now).
Cost: GC-tracked rows are slightly slower to allocate (release build, ns): make_row_fast 108 -> 124, construct_rows 60 -> 80 per row.
F16 - verified, fixed (leak)
PLAIN_TYPES held strong refs to every verified subclass forever (a dynamically created Row subclass was never freed). Now holds weakrefs (dead ones pruned on insert); lookup stays a short list scan. make_row_fast 108 -> 124 ns total with F4. Not changed: a field descriptor added to a class after its first row is still not noticed (a recheck on every call cost ~700 ns per make_row_fast); documented in the code comment. Test: test_verified_subclass_is_not_kept_alive and test_override_in_subclass_body_is_honoured.
F18 - fixed (docs)
ARCHITECTURE.md error section now describes Rust raising (src/errors.rs, DDBCRaiseFor); PYTHON_LAYER_CHANGES.md gains RowCore (PR #4) and Rust error-dispatch (PR #8) sections; Row in row.py is marked RUST-PORT; PLATFORMS_AND_CONNECTION.md lists SqlPassword, ActiveDirectoryPassword and ServicePrincipal as supported, and only ActiveDirectoryIntegrated/WorkloadIdentity/NTLM as unsupported (checked against src/connstr.rs). CHANGELOG Unreleased entry added.
Tests: tests/port and tests/common_issues (incl. new test_rowcore_gc.py) with run_tests.py: all green.
🤖 Generated with Claude Code