Skip to content

fix(python): expose cursor write statistics - #791

Merged
youngsofun merged 4 commits into
mainfrom
fix/python-cursor-rowcount-790
Aug 6, 2026
Merged

fix(python): expose cursor write statistics#791
youngsofun merged 4 commits into
mainfrom
fix/python-cursor-rowcount-790

Conversation

@sundy-li

@sundy-li sundy-li commented Aug 3, 2026

Copy link
Copy Markdown
Member

Summary

  • preserve ServerStats from the blocking cursor query stream instead of dropping stats events
  • report write_progress.rows through DB-API cursor.rowcount
  • expose the latest server statistics through cursor.stats
  • keep executemany rowcount/statistics consistent with execute
  • cover SELECT, INSERT, UPDATE, REPLACE, and stream-load cursor behavior

Closes #790.

Verification

  • cargo fmt --all -- --check
  • cargo check -p databend-python
  • cargo test -p databend-python --lib
  • cd bindings/python && uv run ruff format --check package/databend_driver/__init__.pyi tests/cursor/steps/binding.py
  • git diff --check

Not Run

  • make integration-bindings-python was attempted, but Docker could not pull images because the daemon proxy points to unavailable 127.0.0.1:1090.
  • cargo clippy -p databend-python --all-targets --all-features -- -D warnings was attempted, but it fails on the pre-existing unused chrono::FixedOffset import in bindings/python/src/types.rs.

@sundy-li
sundy-li requested a review from youngsofun August 4, 2026 00:51
@youngsofun
youngsofun merged commit a7bb24a into main Aug 6, 2026
44 checks passed
@youngsofun
youngsofun deleted the fix/python-cursor-rowcount-790 branch August 6, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python driver drops the server's write_progress and always reports rowcount -1, so a write cannot be told from a read

2 participants