[codex] Use non-view registry for Python register#470
Draft
jprafael wants to merge 1 commit into
Draft
Conversation
efe1f8b to
32b37c1
Compare
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.
Summary
register()implementation with a connection-local registry resolved through replacement scans instead of creating a temporary viewunregister()erase the registered Python dependency immediately, including inside an open transactionRoot Cause
register()created a temporary view with an external dependency on the Python object. Whenunregister()ran inside a transaction,DROP VIEWdid not release that dependency until the transaction completed, so large DataFrames stayed alive across the transaction.Validation
SKBUILD_EDITABLE_SKIP=/home/ubuntu/duckdb-sqlite-worktrees/duckdb-python-v1.5.3/build/debug python -m pytest tests/fast/pandas/test_pandas_unregister.py tests/fast/arrow/test_unregister.py tests/fast/api/test_duckdb_connection.py::TestDuckDBConnection::test_register_relation tests/fast/api/test_duckdb_connection.py::TestDuckDBConnection::test_unregister_problematic_behavior tests/fast/pandas/test_same_name.py::TestMultipleColumnsSameName::test_multiple_columns_with_same_name -qunregister()inside a transaction releases the DataFrame immediately and rollback does not resurrect the registered nameregister(), while each registered DataFrame weakref is released afterunregister()