-
Notifications
You must be signed in to change notification settings - Fork 1.4k
sqlite3: fix Connection.cursor() factory argument handling #6783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fix test_is_instance in CursorFactoryTests by properly handling the factory argument in Connection.cursor() method. Now the factory can be passed as both positional and keyword argument, and returns the correct subclass type instead of always returning PyRef<Cursor>. - Use FromArgs derive macro with CursorArgs struct for argument parsing - Return PyObjectRef instead of PyRef<Cursor> to allow subclasses - Use fast_issubclass to validate returned cursor is a Cursor subclass - Properly differentiate between 'no argument' and 'None passed'
📝 WalkthroughWalkthroughThis PR refactors the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
youknowone
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 are you also interested in upgrading sqlite python library to 3.14?
Sure! I noticed the discussion in issue #5974 regarding automated updates is still ongoing. Should I proceed with porting it directly from CPython for now? |
|
Sure, that will take time. We have a lot of things to do to reach there |
|
Oh! don't forget to use |
|
Thanks! |
fixed #6782
CPython Reference
pysqlite_connection_cursor_implSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.