#5314 SQLAlchemy SAWarning with new versions of the library
Opened 2 years ago by zpagure. Modified 2 years ago

When using pagure.lib.query I get the message below from SQLAlchemy. This only seems to happen with the newest releases of SQLAlchemy though (current version 1.4.38). Downgrading to an older version such as SQLAlchemy==1.3.24 does not seem to have the issue.

SAWarning: relationship
'Project.user_projects' will copy column projects.id to column
user_projects.project_id, which conflicts with relationship(s):
'Project.users' (copies projects.id to user_projects.project_id),
'User.co_projects' (copies projects.id to user_projects.project_id). If
this is not the intention, consider if these relationships should be linked
with back_populates, or if viewonly=True should be applied to one or more
if they are read-only. For the less common case that foreign key
constraints are partially overlapping, the orm.foreign() annotation can be
used to isolate the columns that should be written towards. To silence
this warning, add the parameter 'overlaps="co_projects,users"' to the
'Project.user_projects' relationship. (Background on this error at:
https://sqlalche.me/e/14/qzyx)


yeah I also see this warning on my pagure server on F35

Login to comment on this ticket.

Metadata