combax commented on code in PR #76883:
URL: https://github.com/apache/airflow/pull/76883#discussion_r4559179546
##########
providers/common/sql/src/airflow/providers/common/sql/hooks/sql.py:
##########
@@ -983,7 +983,7 @@ def insert_rows(
self.get_conn_id(),
)
- for chunked_rows in chunked(rows, commit_every):
+ for chunked_rows in chunked(rows, commit_every or None):
Review Comment:
Good catch, thank you. You are right that the psycopg2 `fast_executemany`
path has the same problem, and your fix handles both spots there. I
cherry-picked your commit unchanged, so it stays under your name, and I updated
the description to credit you.
I also ran it under psycopg2 against a live Postgres: with `commit_every=0`
that path wrote 0 of 3 rows before and 3 of 3 after, and your test fails
without the fix. Thanks for writing the test as well.
---
Drafted-by: Claude Code (Fable 5.2); reviewed by @combax before posting
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]