You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
executemany() does not check keyword names for an empty parameter list #1112
Since #1102, execute() of the default, dict, Arrow, S3FS, and Spark cursors raises TypeError for unknown keyword arguments. executemany() forwards its keyword arguments to execute() once per parameter set (WithFetch.executemany() in pyathena/result_set.py and WithAsyncFetch.executemany() in pyathena/aio/common.py), so with an empty seq_of_parameters the names are never checked:
cursor.executemany("INSERT INTO t VALUES (%(a)s)", [], work_gruop="typo") # returns without errorcursor.executemany("INSERT INTO t VALUES (%(a)s)", [{"a": 1}], work_gruop="typo") # TypeError
No query runs in the first case, so nothing is lost, but whether a typo is reported depends on the data.
Options
Validate the keyword names in executemany() before the loop.
Activity