'TypeError: expecting numeric data' is only raised for do_executemany

656 views
Skip to first unread message

Kent

unread,
Jan 3, 2012, 1:58:07 PM1/3/12
to sqlalchemy
The statements that are executed as a single statement make no such
check (and the database engine correctly translates a string to
integer), but cursor.executemany checks type:

lib/sqlalchemy/engine/default.py", line 327, in do_executemany
cursor.executemany(statement, parameters)
TypeError: expecting numeric data

You know that inconsistency?

Michael Bayer

unread,
Jan 3, 2012, 3:09:48 PM1/3/12
to sqlal...@googlegroups.com


"cursor" is the DBAPI cursor, so any inconsistencies there are on the DBAPI side. I don't know what the "numeric data" in question would be here.


Kent

unread,
Jan 3, 2012, 3:20:36 PM1/3/12
to sqlalchemy
Oh. Makes sense. Then the only reason I'm starting to hit this is
that you've optimized the orm to use executemany() more often,
correct?

Michael Bayer

unread,
Jan 3, 2012, 3:27:32 PM1/3/12
to sqlal...@googlegroups.com

On Jan 3, 2012, at 3:20 PM, Kent wrote:

> Oh. Makes sense. Then the only reason I'm starting to hit this is
> that you've optimized the orm to use executemany() more often,
> correct?

that it does, yes.


>
> On Jan 3, 3:09 pm, Michael Bayer <mike...@zzzcomputing.com> wrote:
>> On Jan 3, 2012, at 1:58 PM, Kent wrote:
>>
>>> The statements that are executed as a single statement make no such
>>> check (and the database engine correctly translates a string to
>>> integer), but cursor.executemany checks type:
>>
>>> lib/sqlalchemy/engine/default.py", line 327, in do_executemany
>>> cursor.executemany(statement, parameters)
>>> TypeError: expecting numeric data
>>
>>> You know that inconsistency?
>>
>> "cursor" is the DBAPI cursor, so any inconsistencies there are on the DBAPI side. I don't know what the "numeric data" in question would be here.
>

> --
> You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
> To post to this group, send email to sqlal...@googlegroups.com.
> To unsubscribe from this group, send email to sqlalchemy+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
>

Reply all
Reply to author
Forward
0 new messages