sqlite3: add Cursor.row_factory pygetset and fix Connection.cursor() …#7278
Conversation
…propagation Add #[pygetset] getter/setter for Cursor.row_factory so that Python-level attribute access reads/writes the Rust struct field instead of the instance dict. Fix Connection.cursor() to only propagate the connection's row_factory to the cursor when the connection's row_factory is not None, matching CPython behavior. Previously it unconditionally overwrote the cursor's row_factory, discarding any factory set by a cursor subclass __init__.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughModified row_factory transfer logic in Cursor wrapping to add conditions for downcast capability and factory presence. Added two public accessor methods to the Cursor class: Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: Error: 'frozenset' object has no attribute 'discard' Legend:
|
@ShaharNaveh you may want to take a look into this |
#7276 :) |
…propagation
Add #[pygetset] getter/setter for Cursor.row_factory so that Python-level attribute access reads/writes the Rust struct field instead of the instance dict.
Fix Connection.cursor() to only propagate the connection's row_factory to the cursor when the connection's row_factory is not None, matching CPython behavior. Previously it unconditionally overwrote the cursor's row_factory, discarding any factory set by a cursor subclass init.
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes