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
We'd like declare ObsRawNativeFlags and ObsRawPCICFlags in declarative base (class) style, as below.
If we do so withprimary_key=True, some tests error out (specifically, but I suspect not only, tests/alembic_migrations/versions/v_7a3b247c577b_add_varsperhistory_native_matview/test_matview.py::test_vars_content).
If we omit primary_key, then SQLAlchemy objects that it cannot determine primary key columns for the table, which is hardly surprising.
Figure out what is going on here and fix it.
Question: Why is it OK to declare a table without primary keys using a functional X = Table(...) declaration, and not using class X?
If the table already exist you can reference to the fields directly:
class Humans(Base):
__table__ = people_table
id = people_table.c.PeopleID
name = people_table.c.PeopleName
In the absence of a better solution, this may give us a way to at least give the effect of a declarative style, whilst retaining the Table definitions. Benefit: Code completion will work better. Nada más.
We'd like declare
ObsRawNativeFlags
andObsRawPCICFlags
in declarative base (class) style, as below.If we do so with
primary_key=True
, some tests error out (specifically, but I suspect not only,tests/alembic_migrations/versions/v_7a3b247c577b_add_varsperhistory_native_matview/test_matview.py::test_vars_content
).If we omit
primary_key
, then SQLAlchemy objects that it cannot determine primary key columns for the table, which is hardly surprising.Figure out what is going on here and fix it.
Question: Why is it OK to declare a table without primary keys using a functional
X = Table(...)
declaration, and not usingclass X
?The text was updated successfully, but these errors were encountered: