Re: [sqlalchemy] Implicitly combining columns message

2020-12-22 Thread Larry Martell
On Tue, Dec 22, 2020 at 2:53 PM Mike Bayer wrote: > > > > On Tue, Dec 22, 2020, at 2:15 PM, Larry Martell wrote: > > I would think: > > su = session.query(ServerUtilization).filter(ServerUtilization.serverName > == "server1").one() > > would use the data from ServerUtilization only. Does SQLA

Re: [sqlalchemy] Implicitly combining columns message

2020-12-22 Thread Mike Bayer
On Tue, Dec 22, 2020, at 2:15 PM, Larry Martell wrote: > I would think: > > su = session.query(ServerUtilization).filter(ServerUtilization.serverName > == "server1").one() > > would use the data from ServerUtilization only. Does SQLA implicitly > join the 2 tables even if no columns from

Re: [sqlalchemy] Implicitly combining columns message

2020-12-22 Thread Larry Martell
I would think: su = session.query(ServerUtilization).filter(ServerUtilization.serverName == "server1").one() would use the data from ServerUtilization only. Does SQLA implicitly join the 2 tables even if no columns from Server are referenced? On Tue, Dec 22, 2020 at 1:57 PM Mike Bayer wrote: >

Re: [sqlalchemy] Implicitly combining columns message

2020-12-22 Thread Mike Bayer
it's important to distinguish between "Python attributes" and "database table columns", these are two separate things. Both tables in your database may have a column named "updatedDate". There is no restriction on database table structure. Your ServerUtilization class, which refers to *both*

Re: [sqlalchemy] Implicitly combining columns message

2020-12-22 Thread Larry Martell
So because ServerUtilization has a FK relation to Server they cannot have any columns with the same name? On Tue, Dec 22, 2020 at 1:28 PM Mike Bayer wrote: > > this error means that your Server class has a column attribute which you > would access as Server.updatedDate. Your ServerUtilization

Re: [sqlalchemy] Implicitly combining columns message

2020-12-22 Thread Mike Bayer
this error means that your Server class has a column attribute which you would access as Server.updatedDate. Your ServerUtilization subclass has another column attribute which you would also access as ServerUtilization.updatedDate. the problem arises in that ServerUtilization refers to the

[sqlalchemy] Implicitly combining columns message

2020-12-22 Thread Larry Martell
I have these 2 models: class Server(Base): __tablename__ = 'Server' serverName = Column(String(50, 'SQL_Latin1_General_CP1_CI_AS'), primary_key=True) serverTypeEnumID = Column(Integer) serverComponentEnumID = Column(ForeignKey('Enumeration.enumID')) serverEnvironmentEnumID =