so as these issues tend to be reported in pairs, literally there is a similar issue against geoalchemy2 where the same code is causing a problem. 0.9 does this same comparison but it doesn't attempt to evaluate the __bool__ of the object so I'll fix that: https://bitbucket.org/zzzeek/sqlalchemy/issue/3469/comparison-in-persistencepy-can-trip-up-on
On 7/1/15 11:47 AM, Tim Pierson wrote:
Thanks for the response and the link to the associated method, there was indeed a numpy datatype (not) being serialized on the linux platform codebase.Numpy has become second nature; I apparently cannot distinguish between it's errors and python errors!On Saturday, June 27, 2015 at 1:02:00 AM UTC-4, Michael Bayer wrote: 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 <javascript:>') 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 <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 theGoogle Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com <javascript:>. To post to this group, send email to sqlal...@googlegroups.com <javascript:>. Visit this group at http://groups.google.com/group/sqlalchemy <http://groups.google.com/group/sqlalchemy>. For more options, visit https://groups.google.com/d/optout <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 <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.