Re: [sqlalchemy] AbstractConcreteBase and query_expression()

2020-03-25 Thread Mike Bayer
I don't really know, because AbstractConcreteBase works pretty poorly and it's better to use other patterns. Try this workaround, which I have no idea if it helps in this case: class A(...): # ... @classmethod def __declare_last__(cls): cls.__mapper__.with_polymorphic = ("*",

Re: [sqlalchemy] looking for help building relationship that references an intermediate mixer table

2020-03-25 Thread Simon King
Do you need it to be an actual relationship? It's common to use an association proxy for this: https://docs.sqlalchemy.org/en/13/orm/extensions/associationproxy.html#simplifying-association-objects Hope that helps, Simon On Fri, Mar 20, 2020 at 7:47 PM Mark Aquino wrote: > > I'd like to

[sqlalchemy] AbstractConcreteBase and query_expression()

2020-03-25 Thread Benjamin Beguin
Hi there, I'm facing an issue with the use of AbstractConcreteBase class and a @declarred_attr returning a query_expression() class A(AbstractConcreteBase, Base): @declared_attr def foo(cls): return query_expression() class B(A): ... class C(A): ... objects =

Re: [sqlalchemy] Cleaning metadata

2020-03-25 Thread Mike Bayer
On Wed, Mar 25, 2020, at 6:27 AM, Javier Collado Jiménez wrote: > Hello, > I'm having a problem trying to cleanup sqlalchemy objects. My application has > a thread which handles DB connections. In some cases the thread dies and I > want to do a cleanup so, next time the thread is started it

Re: [sqlalchemy] Cleaning metadata

2020-03-25 Thread Simon King
It's difficult to answer this question without knowing how your code is structured. Are you reflecting your tables from the database, or have you defined them statically? What is the full stack trace when you get those errors? Simon On Wed, Mar 25, 2020 at 10:27 AM Javier Collado Jiménez

Re: [sqlalchemy] SQLAlchemy URI (in superset) to connect to SSL enabled DRUI UI

2020-03-25 Thread Simon King
I've never used Druid, but this is really a question for the pydruid project, I don't know if any of those developers are on this list. It looks like pydruid only recently started supporting self-signed certificates (or allowing you to ignore certificate errors):

[sqlalchemy] Cleaning metadata

2020-03-25 Thread Javier Collado Jiménez
Hello, I'm having a problem trying to cleanup sqlalchemy objects. My application has a thread which handles DB connections. In some cases the thread dies and I want to do a cleanup so, next time the thread is started it would be able to reconnect again. The steps I tried are: