You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am getting complaints about the sqlalchemy targetdb tables Assignment and ProgramToTarget not having foreign keys whenever I try to load these models and perform a simple query. I can import the database and models ok but running a query triggers the failure.
AttributeError: type object 'Assignment' has no attribute 'foreign_keys'
AttributeError: type object 'ProgramToTarget' has no attribute 'foreign_keys'
The full traceback is down below.
To Reproduce
from sdssdb.sqlalchemy.sdss5db import database as sdss5db, targetdb
[WARNING]: support for catalogdb in SQLalchemy is incomplete. Use Peewee instead. (SdssdbWarning)
sdss5db
<SDSS5dbDatabaseConnection (dbname='sdss5db', profile='local', connected=True)>
session=sdss5db.Session()
session.query(targetdb.Program).first()
I'm not really maintaining the SQLA part of sdss5db and I'm not surprised it does not work. Since things are in flux right now I would not put a lot of effort in fixing something that can change again later. It may be better to reduce the confusion by removing the schema from sqlalchemy.
I ended up removing the SQLA implementation of sdss5db. The schema is quite in flux and I prefer to not give the option of using it in SQLA if it's not correct. We can reintroduce it later once things are fixed.
Describe the bug
I am getting complaints about the sqlalchemy
targetdb
tablesAssignment
andProgramToTarget
not having foreign keys whenever I try to load these models and perform a simple query. I can import the database and models ok but running a query triggers the failure.The full traceback is down below.
To Reproduce
Additional context
I dumped my existing
targetdb
schema and reloaded the latest one from at https://github.com/sdss/sdssdb/blob/master/schema/sdss5db/targetdb/targetdb.sqlFull traceback
The text was updated successfully, but these errors were encountered: