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
When running tests, we receive a whole slew of errors related to conflicting relationships. These warnings look like the following:
/usr/src/app/OpenOversight/tests/conftest.py:272: SAWarning: relationship 'User.tags' will copy column users.id to column faces.user_id, which conflicts with relationship(s): 'Face.user' (copies users.id to faces.user_id), 'User.faces' (copies users.id to faces.user_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="faces,user"' to the 'User.tags' relationship.
department = models.Department(
I don't have enough experience with SQL-Alchemy to understand what's going on here, or what might be the problem. This affects the following models:
tests/conftest.py:537
tests/conftest.py:537
tests/conftest.py:537
/usr/src/app/OpenOversight/tests/conftest.py:537: SAWarning: relationship 'Officer.assignments_lazy' will copy column officers.id to column assignments.officer_id, which conflicts with relationship(s): 'Assignment.officer' (copies officers.id to assignments.officer_id), 'Officer.assignments' (copies officers.id to assignments.officer_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="assignments,officer"' to the 'Officer.assignments_lazy' relationship.
department = models.Department(
tests/conftest.py:537
tests/conftest.py:537
tests/conftest.py:537
/usr/src/app/OpenOversight/tests/conftest.py:537: SAWarning: relationship 'Assignment.baseofficer' will copy column officers.id to column assignments.officer_id, which conflicts with relationship(s): 'Assignment.officer' (copies officers.id to assignments.officer_id), 'Officer.assignments' (copies officers.id to assignments.officer_id), 'Officer.assignments_lazy' (copies officers.id to assignments.officer_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="assignments,assignments_lazy,officer"' to the 'Assignment.baseofficer' relationship.
department = models.Department(
tests/conftest.py:537
tests/conftest.py:537
tests/conftest.py:537
/usr/src/app/OpenOversight/tests/conftest.py:537: SAWarning: relationship 'Image.users' will copy column users.id to column raw_images.user_id, which conflicts with relationship(s): 'Image.user' (copies users.id to raw_images.user_id), 'User.raw_images' (copies users.id to raw_images.user_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="raw_images,user"' to the 'Image.users' relationship.
department = models.Department(
tests/conftest.py:537
tests/conftest.py:537
tests/conftest.py:537
/usr/src/app/OpenOversight/tests/conftest.py:537: SAWarning: relationship 'User.classifications' will copy column users.id to column raw_images.user_id, which conflicts with relationship(s): 'Image.user' (copies users.id to raw_images.user_id), 'User.raw_images' (copies users.id to raw_images.user_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="raw_images,user"' to the 'User.classifications' relationship.
department = models.Department(
tests/conftest.py:537
tests/conftest.py:537
tests/conftest.py:537
/usr/src/app/OpenOversight/tests/conftest.py:537: SAWarning: relationship 'Face.users' will copy column users.id to column faces.user_id, which conflicts with relationship(s): 'Face.user' (copies users.id to faces.user_id), 'User.faces' (copies users.id to faces.user_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="faces,user"' to the 'Face.users' relationship.
department = models.Department(
tests/conftest.py:537
tests/conftest.py:537
tests/conftest.py:537
/usr/src/app/OpenOversight/tests/conftest.py:537: SAWarning: relationship 'User.tags' will copy column users.id to column faces.user_id, which conflicts with relationship(s): 'Face.user' (copies users.id to faces.user_id), 'User.faces' (copies users.id to faces.user_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="faces,user"' to the 'User.tags' relationship.
department = models.Department(
tests/test_commands.py:86
/usr/src/app/OpenOversight/tests/test_commands.py:86: SAWarning: relationship 'Officer.assignments_lazy' will copy column officers.id to column assignments.officer_id, which conflicts with relationship(s): 'Assignment.officer' (copies officers.id to assignments.officer_id), 'Officer.assignments' (copies officers.id to assignments.officer_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="assignments,officer"' to the 'Officer.assignments_lazy' relationship.
department = Department(name=name, short_name=short_name)
tests/test_commands.py:86
/usr/src/app/OpenOversight/tests/test_commands.py:86: SAWarning: relationship 'Assignment.baseofficer' will copy column officers.id to column assignments.officer_id, which conflicts with relationship(s): 'Assignment.officer' (copies officers.id to assignments.officer_id), 'Officer.assignments' (copies officers.id to assignments.officer_id), 'Officer.assignments_lazy' (copies officers.id to assignments.officer_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="assignments,assignments_lazy,officer"' to the 'Assignment.baseofficer' relationship.
department = Department(name=name, short_name=short_name)
tests/test_commands.py:86
/usr/src/app/OpenOversight/tests/test_commands.py:86: SAWarning: relationship 'Image.users' will copy column users.id to column raw_images.user_id, which conflicts with relationship(s): 'Image.user' (copies users.id to raw_images.user_id), 'User.raw_images' (copies users.id to raw_images.user_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="raw_images,user"' to the 'Image.users' relationship.
department = Department(name=name, short_name=short_name)
tests/test_commands.py:86
/usr/src/app/OpenOversight/tests/test_commands.py:86: SAWarning: relationship 'User.classifications' will copy column users.id to column raw_images.user_id, which conflicts with relationship(s): 'Image.user' (copies users.id to raw_images.user_id), 'User.raw_images' (copies users.id to raw_images.user_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="raw_images,user"' to the 'User.classifications' relationship.
department = Department(name=name, short_name=short_name)
tests/test_commands.py:86
/usr/src/app/OpenOversight/tests/test_commands.py:86: SAWarning: relationship 'Face.users' will copy column users.id to column faces.user_id, which conflicts with relationship(s): 'Face.user' (copies users.id to faces.user_id), 'User.faces' (copies users.id to faces.user_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="faces,user"' to the 'Face.users' relationship.
department = Department(name=name, short_name=short_name)
tests/test_commands.py:86
/usr/src/app/OpenOversight/tests/test_commands.py:86: SAWarning: relationship 'User.tags' will copy column users.id to column faces.user_id, which conflicts with relationship(s): 'Face.user' (copies users.id to faces.user_id), 'User.faces' (copies users.id to faces.user_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="faces,user"' to the 'User.tags' relationship.
department = Department(name=name, short_name=short_name)
tests/conftest.py:232
/usr/src/app/OpenOversight/tests/conftest.py:232: SAWarning: transaction already deassociated from connection
transaction.rollback()
app/commands.py:598
/usr/src/app/OpenOversight/app/commands.py:598: SAWarning: relationship 'Officer.assignments_lazy' will copy column officers.id to column assignments.officer_id, which conflicts with relationship(s): 'Assignment.officer' (copies officers.id to assignments.officer_id), 'Officer.assignments' (copies officers.id to assignments.officer_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="assignments,officer"' to the 'Officer.assignments_lazy' relationship.
dept = Department(
app/commands.py:598
/usr/src/app/OpenOversight/app/commands.py:598: SAWarning: relationship 'Assignment.baseofficer' will copy column officers.id to column assignments.officer_id, which conflicts with relationship(s): 'Assignment.officer' (copies officers.id to assignments.officer_id), 'Officer.assignments' (copies officers.id to assignments.officer_id), 'Officer.assignments_lazy' (copies officers.id to assignments.officer_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="assignments,assignments_lazy,officer"' to the 'Assignment.baseofficer' relationship.
dept = Department(
app/commands.py:598
/usr/src/app/OpenOversight/app/commands.py:598: SAWarning: relationship 'Image.users' will copy column users.id to column raw_images.user_id, which conflicts with relationship(s): 'Image.user' (copies users.id to raw_images.user_id), 'User.raw_images' (copies users.id to raw_images.user_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="raw_images,user"' to the 'Image.users' relationship.
dept = Department(
app/commands.py:598
/usr/src/app/OpenOversight/app/commands.py:598: SAWarning: relationship 'User.classifications' will copy column users.id to column raw_images.user_id, which conflicts with relationship(s): 'Image.user' (copies users.id to raw_images.user_id), 'User.raw_images' (copies users.id to raw_images.user_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="raw_images,user"' to the 'User.classifications' relationship.
dept = Department(
app/commands.py:598
/usr/src/app/OpenOversight/app/commands.py:598: SAWarning: relationship 'Face.users' will copy column users.id to column faces.user_id, which conflicts with relationship(s): 'Face.user' (copies users.id to faces.user_id), 'User.faces' (copies users.id to faces.user_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="faces,user"' to the 'Face.users' relationship.
dept = Department(
app/commands.py:598
/usr/src/app/OpenOversight/app/commands.py:598: SAWarning: relationship 'User.tags' will copy column users.id to column faces.user_id, which conflicts with relationship(s): 'Face.user' (copies users.id to faces.user_id), 'User.faces' (copies users.id to faces.user_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="faces,user"' to the 'User.tags' relationship.
dept = Department(
tests/conftest.py:272
tests/conftest.py:272
tests/conftest.py:272
/usr/src/app/OpenOversight/tests/conftest.py:272: SAWarning: relationship 'Officer.assignments_lazy' will copy column officers.id to column assignments.officer_id, which conflicts with relationship(s): 'Assignment.officer' (copies officers.id to assignments.officer_id), 'Officer.assignments' (copies officers.id to assignments.officer_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="assignments,officer"' to the 'Officer.assignments_lazy' relationship.
department = models.Department(
tests/conftest.py:272
tests/conftest.py:272
tests/conftest.py:272
/usr/src/app/OpenOversight/tests/conftest.py:272: SAWarning: relationship 'Assignment.baseofficer' will copy column officers.id to column assignments.officer_id, which conflicts with relationship(s): 'Assignment.officer' (copies officers.id to assignments.officer_id), 'Officer.assignments' (copies officers.id to assignments.officer_id), 'Officer.assignments_lazy' (copies officers.id to assignments.officer_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="assignments,assignments_lazy,officer"' to the 'Assignment.baseofficer' relationship.
department = models.Department(
tests/conftest.py:272
tests/conftest.py:272
tests/conftest.py:272
/usr/src/app/OpenOversight/tests/conftest.py:272: SAWarning: relationship 'Image.users' will copy column users.id to column raw_images.user_id, which conflicts with relationship(s): 'Image.user' (copies users.id to raw_images.user_id), 'User.raw_images' (copies users.id to raw_images.user_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="raw_images,user"' to the 'Image.users' relationship.
department = models.Department(
tests/conftest.py:272
tests/conftest.py:272
tests/conftest.py:272
/usr/src/app/OpenOversight/tests/conftest.py:272: SAWarning: relationship 'User.classifications' will copy column users.id to column raw_images.user_id, which conflicts with relationship(s): 'Image.user' (copies users.id to raw_images.user_id), 'User.raw_images' (copies users.id to raw_images.user_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="raw_images,user"' to the 'User.classifications' relationship.
department = models.Department(
tests/conftest.py:272
tests/conftest.py:272
tests/conftest.py:272
/usr/src/app/OpenOversight/tests/conftest.py:272: SAWarning: relationship 'Face.users' will copy column users.id to column faces.user_id, which conflicts with relationship(s): 'Face.user' (copies users.id to faces.user_id), 'User.faces' (copies users.id to faces.user_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="faces,user"' to the 'Face.users' relationship.
department = models.Department(
tests/conftest.py:272
tests/conftest.py:272
tests/conftest.py:272
/usr/src/app/OpenOversight/tests/conftest.py:272: SAWarning: relationship 'User.tags' will copy column users.id to column faces.user_id, which conflicts with relationship(s): 'Face.user' (copies users.id to faces.user_id), 'User.faces' (copies users.id to faces.user_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="faces,user"' to the 'User.tags' relationship.
department = models.Department(
The text was updated successfully, but these errors were encountered:
When running tests, we receive a whole slew of errors related to conflicting relationships. These warnings look like the following:
I don't have enough experience with SQL-Alchemy to understand what's going on here, or what might be the problem. This affects the following models:
Assignment.baseofficer
[officers.id
] -> [assignments.officer_id
]Face.users
[users.id
] -> [faces.user_id
]Image.users
[users.id
] -> [raw_images.user_id
]Officer.assignments_lazy
[officers.id
] -> [assignments.officer_id
]User.classifications
[users.id
] -> [raw_images.user_id
]User.tags
[users.id
] -> [faces.user_id
]Full warning output
The text was updated successfully, but these errors were encountered: