Re: [sqlalchemy] MetaData().reflect() fails on engine with non-default isolation level

2019-07-08 Thread Mike Bayer
On Mon, Jul 8, 2019, at 6:08 AM, Gunnar Þór Magnússon wrote: > Hello, > > Some legacy code at work that I don't fully understand (and whose authors are > all long gone) does the following to eventually insert some values into the > table it gets: > > meta =

Re: [sqlalchemy] programming error (psycopg2.ProgrammingError) can't adapt type 'Point'

2019-07-08 Thread Mike Bayer
On Mon, Jul 8, 2019, at 4:45 AM, Mauro Mussin wrote: > I have a postgres-postgis dB with a geometry:point field: if I insert the > values directly > INSERT INTO points(coordinates) VALUES (ST_GeomFromText('POINT(10.809003 > 54.097834)',4326)); > > no issue, but if I use this sequence

Re: [sqlalchemy] Re: not the same number of columns in the 2 queries of the recursive request

2019-07-08 Thread Mike Bayer
are you able to set echo="debug" on your create_engine(), view the SQL being emitted as well as the results being returned, and then ensure the SQL statement and results are what you are looking for? once you have that we can make sure the ORM interprets these results correctly. On Sun, Jul

[sqlalchemy] MetaData().reflect() fails on engine with non-default isolation level

2019-07-08 Thread Gunnar Þór Magnússon
Hello, Some legacy code at work that I don't fully understand (and whose authors are all long gone) does the following to eventually insert some values into the table it gets: meta = sqlalchemy.MetaData(bind=session.get_bind()) meta.reflect() table = sqlalchemy.Table(TableName.__tablename__,

[sqlalchemy] programming error (psycopg2.ProgrammingError) can't adapt type 'Point'

2019-07-08 Thread Mauro Mussin
I have a postgres-postgis dB with a geometry:point field: if I insert the values directly INSERT INTO points(coordinates) VALUES (ST_GeomFromText('POINT(10.809003 54.097834)',4326)); no issue, but if I use this sequence (Python) *->import data in a dataframe: data contains lat and long

Re: [sqlalchemy] "No such polymorphic_identity" when models in different modules

2019-07-08 Thread natsjoo sodillepa
Got it. As I like to "eat the pudding": x.py: class Meta(type): print("Here is Meta") def __new__(cls, name, bases, dct): print("meta.new") return super().__new__(cls, name, bases, dct) class Foo(metaclass=Meta): print("Here is Foo") y.py: from x import Foo class