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
Type annotation for executemany seq_of_parameters invalid for pyformat style #469
The type annotation for seq_of_parameters in Cursor.executemany does not appear to be correct for the pyformat style where seq_of_parameters might be a list of dicts/mappings with parameter names as keys.
To reproduce
Using pyright as a typechecker:
query="..."params: list[dict[str, Any]] = [{"param1": "foo", "param2": "bar"}]
cursor.executemany(query, params) # pyright error: "Argument of type "list[dict[str, Any]]" cannot be assigned to parameter "seq_of_parameters" of type "List[Sequence[Any]]" in function "executemany""
executemany should accept any seq_of_params that matches the shape [{"key": <value>}]. Something like List[Sequence[Any]] | List[Mapping[str, Any]] or List[Sequence[Any]] | List[Dict[str, Any]]
Though dict does implement the __getitem__ and __len__ methods of the Sequence protocol, it is not technically a Sequence (see PySequence_Check as well as the isinstance check shown above)
Not that big of a deal in the grand scheme of things but would be nice to avoid having to put "#pyright: ignore[reportArgumentType]" in calling code. Happy to submit a PR for this too, but wanted to submit the issue first.
Hi Zachary Eller (@zacharyeller13) - Thanks a lot for raising the issue and posting all the details.
We've triaged this is a bug in our typing declaration - and we'll post if anything else is needed from your end.
Thanks again, we'll keep the issue posted as we go ahead to fix this.
Zachary Eller (@zacharyeller13) - this is now fixed and shipped with our latest release (v1.6.0)
please check and let us know if issue persists - closing this for now
thanks for raising this issue! :)
Activity
github-actions commentedon Mar 6, 2026
Hi Zachary Eller (@zacharyeller13), thank you for opening this issue!
Our team will review it shortly. We aim to triage all new issues within 24-48 hours and get back to you.
If you have additional information to share, please feel free to update the issue.
Thank you for your patience!
bewithgaurav commentedon Mar 17, 2026
Hi Zachary Eller (@zacharyeller13) - Thanks a lot for raising the issue and posting all the details.
We've triaged this is a bug in our typing declaration - and we'll post if anything else is needed from your end.
Thanks again, we'll keep the issue posted as we go ahead to fix this.
Fix type annotation for executemany seq_of_parameters to accept Mapping
Fix type annotation for executemany seq_of_parameters to accept Mapping
FIX: Type annotation for executemany seq_of_parameters to accept Mapp…
bewithgaurav commentedon Apr 29, 2026
Zachary Eller (@zacharyeller13) - this is now fixed and shipped with our latest release (v1.6.0)
please check and let us know if issue persists - closing this for now
thanks for raising this issue! :)
FIX: Produce universal2 wheel for Python 3.10 on macOS (#542)