Fix sqlite3 Cursor.fetchmany to not fetch rows when size=0#7425
Fix sqlite3 Cursor.fetchmany to not fetch rows when size=0#7425youknowone merged 1 commit intoRustPython:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRefactors the row-collection loop in the SQLite fetchmany method to use an explicit remaining-count variable and match on Cursor::next instead of breaking when max_rows count is reached. The control flow now handles StopIteration explicitly with equivalent functionality but clearer iteration semantics. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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)
📝 Coding Plan
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: [ ] lib: cpython/Lib/locale.py dependencies:
dependent tests: (96 tests)
[x] lib: cpython/Lib/modulefinder.py dependencies:
dependent tests: (2 tests)
[ ] lib: cpython/Lib/pkgutil.py dependencies:
dependent tests: (7 tests)
[x] lib: cpython/Lib/poplib.py dependencies:
dependent tests: (1 tests)
[ ] lib: cpython/Lib/smtplib.py dependencies:
dependent tests: (5 tests)
[ ] lib: cpython/Lib/asyncio dependencies:
dependent tests: (7 tests)
[x] test: cpython/Lib/test/test_builtin.py (TODO: 25) dependencies: dependent tests: (no tests depend on builtin) [ ] lib: cpython/Lib/collections dependencies:
dependent tests: (302 tests)
[ ] lib: cpython/Lib/concurrent dependencies:
dependent tests: (16 tests)
[x] lib: cpython/Lib/dataclasses.py dependencies:
dependent tests: (90 tests)
[ ] test: cpython/Lib/test/test_decorators.py (TODO: 1) dependencies: dependent tests: (no tests depend on decorators) [ ] test: cpython/Lib/test/test_descr.py (TODO: 47) dependencies: dependent tests: (no tests depend on descr) [x] lib: cpython/Lib/doctest.py dependencies:
dependent tests: (33 tests)
[x] test: cpython/Lib/test/test_fork1.py (TODO: 1) dependencies: dependent tests: (no tests depend on fork1) [x] test: cpython/Lib/test/test_format.py (TODO: 7) dependencies: dependent tests: (no tests depend on format) [x] test: cpython/Lib/test/test_frame.py (TODO: 14) dependencies: dependent tests: (no tests depend on frame) [x] lib: cpython/Lib/ftplib.py dependencies:
dependent tests: (34 tests)
[x] test: cpython/Lib/test/test_gc.py dependencies: dependent tests: (168 tests)
[ ] test: cpython/Lib/test/test_generators.py (TODO: 12) dependencies: dependent tests: (no tests depend on generator) [x] lib: cpython/Lib/importlib dependencies:
dependent tests: (112 tests)
[ ] test: cpython/Lib/test/test_marshal.py (TODO: 21) dependencies: dependent tests: (21 tests)
[ ] lib: cpython/Lib/multiprocessing dependencies:
dependent tests: (11 tests)
[x] lib: cpython/Lib/os.py dependencies:
dependent tests: (171 tests)
[x] lib: cpython/Lib/pickle.py dependencies:
dependent tests: (97 tests)
[ ] test: cpython/Lib/test/test_raise.py dependencies: dependent tests: (no tests depend on raise) [x] lib: cpython/Lib/runpy.py dependencies:
dependent tests: (2 tests)
[x] lib: cpython/Lib/sqlite3 dependencies:
dependent tests: (2 tests)
[x] lib: cpython/Lib/symtable.py dependencies:
dependent tests: (2 tests)
[x] lib: cpython/Lib/tabnanny.py dependencies:
dependent tests: (1 tests)
[x] lib: cpython/Lib/threading.py dependencies:
dependent tests: (150 tests)
[ ] lib: cpython/Lib/tokenize.py dependencies:
dependent tests: (135 tests)
[ ] lib: cpython/Lib/trace.py dependencies:
dependent tests: (1 tests)
[ ] test: cpython/Lib/test/test_tuple.py (TODO: 1) dependencies: dependent tests: (no tests depend on tuple) [x] lib: cpython/Lib/types.py dependencies:
dependent tests: (52 tests)
[ ] test: cpython/Lib/test/test_utf8source.py (TODO: 2) dependencies: dependent tests: (no tests depend on utf8source) [x] lib: cpython/Lib/weakref.py dependencies:
dependent tests: (204 tests)
Legend:
|
CPython reference
https://github.com/python/cpython/blob/main/Modules/_sqlite/cursor.c#L1233-L1240
Summary by CodeRabbit