On 6/26/15 6:42 PM, Tim Pierson wrote:
Hi,
I wonder if anyone can help with the below stack-trace. The code in question works perfectly under Windows to MSSQL with the following connection string (params omitted):

    ENGINE =
    sa.create_engine('mssql://DBSERVER/DB?trusted_connection=yes')


but something becomes an array when the same code is run in linux with the following connection string (params omitted):

    ENGINE =
    
sa.create_engine('mssql+pyodbc://USER:PASS@DBSERVER_IP:PORT/DB?driver=FreeTDS;TDS_Version=8.0')


Both strings can be used to run queries without a problem.

that's not any message SQLAlchemy is rendering; a google search indicates it's a numpy-specific error. SQLAlchemy has no built-in numpy-oriented datatypes, so this is some numpy-specific SQLAlchemy extension that isn't correctly implementing comparison operations on the SQLAlchemy datatype object that is used for persistence (specifically this method: http://docs.sqlalchemy.org/en/rel_1_0/core/custom_types.html#sqlalchemy.types.TypeDecorator.compare_values).

You'd need to provide detail on this datatype and how it is mapped, most usefully in the form of a self-contained test case; or better yet just report the test case up to the numpy-related library you're using.





Thanks for any information!

stack below:

[. . .]
self.db.session.commit()
File "/home/tpierson/theano_env/lib/python2.7/site-packages/sqlalchemy/orm/scoping.py", line 150, in do
    return getattr(self.registry(), name)(*args, **kwargs)
File "/home/tpierson/theano_env/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 790, in commit
    self.transaction.commit()
File "/home/tpierson/theano_env/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 392, in commit
    self._prepare_impl()
File "/home/tpierson/theano_env/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 372, in _prepare_impl
    self.session.flush()
File "/home/tpierson/theano_env/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2004, in flush
    self._flush(objects)
File "/home/tpierson/theano_env/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2122, in _flush
    transaction.rollback(_capture_exception=True)
File "/home/tpierson/theano_env/lib/python2.7/site-packages/sqlalchemy/util/langhelpers.py", line 60, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
File "/home/tpierson/theano_env/lib/python2.7/site-packages/sqlalchemy/orm/session.py", line 2086, in _flush
    flush_context.execute()
File "/home/tpierson/theano_env/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 373, in execute
    rec.execute(self)
File "/home/tpierson/theano_env/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py", line 532, in execute
    uow
File "/home/tpierson/theano_env/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 170, in save_obj
    mapper, table, update)
File "/home/tpierson/theano_env/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 630, in _emit_update_statements
    lambda rec: (
File "/home/tpierson/theano_env/lib/python2.7/site-packages/sqlalchemy/orm/persistence.py", line 459, in _collect_update_commands
    value, state.committed_state[propkey]):
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com <mailto:sqlalchemy+unsubscr...@googlegroups.com>. To post to this group, send email to sqlalchemy@googlegroups.com <mailto:sqlalchemy@googlegroups.com>.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to