Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 FIX: sqlalchemy v2 API warning #5177

Merged
merged 1 commit into from
Oct 15, 2021
Merged

🐛 FIX: sqlalchemy v2 API warning #5177

merged 1 commit into from
Oct 15, 2021

Conversation

chrisjsewell
Copy link
Member

This commit fixes a warning that is generated by the sqlalchemy:

SAWarning: relationship 'DbLink.input' will copy column db_dbnode.id to column db_dblink.input_id, which conflicts with relationship(s): 'DbNode.inputs_q' (copies db_dbnode.id to db_dblink.input_id), 'DbNode.outputs_q' (copies db_dbnode.id to db_dblink.input_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="inputs_q,outputs_q"' to the 'DbLink.input' relationship.

Note a similar fix was made in aldjemy/aldjemy#199

This commit fixes a warning that is generated by the sqlalchemy:

SAWarning: relationship 'DbLink.input' will copy column db_dbnode.id to column db_dblink.input_id, which conflicts with relationship(s): 'DbNode.inputs_q' (copies db_dbnode.id to db_dblink.input_id), 'DbNode.outputs_q' (copies db_dbnode.id to db_dblink.input_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="inputs_q,outputs_q"' to the 'DbLink.input' relationship.

Note a similar fix was made in aldjemy/aldjemy#199
@codecov
Copy link

codecov bot commented Oct 15, 2021

Codecov Report

Merging #5177 (4dc99d8) into develop (5acf437) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #5177   +/-   ##
========================================
  Coverage    80.93%   80.93%           
========================================
  Files          536      536           
  Lines        37056    37056           
========================================
  Hits         29987    29987           
  Misses        7069     7069           
Flag Coverage Δ
django 75.78% <100.00%> (+0.01%) ⬆️
sqlalchemy 74.93% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiida/backends/sqlalchemy/models/node.py 81.82% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5acf437...4dc99d8. Read the comment docs.

@chrisjsewell chrisjsewell merged commit 0b7db7b into develop Oct 15, 2021
@chrisjsewell chrisjsewell deleted the fix/sqla-overlap branch October 15, 2021 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant