fnl / medic

a Python 3 command-line tool to maintain a DB mirror of MEDLINE (https://pypi.python.org/pypi/medic) - ALERT: As I have moved out of science and am working as a consultant now, this project might need a new maintainer once PubMed changes its XML format. Heroes?
GNU General Public License v3.0
25 stars 16 forks source link

Receiving SQL Alchemy warning when starting medic #4

Open henn opened 8 years ago

henn commented 8 years ago

FYI - receiving the following warning when loading medic (DB is postgres 9.4):

$ medic write 123                                         
venv/lib/python3.4/site-packages/sqlalchemy/orm/relationships.py:2679: SA
Warning: relationship 'Qualifier.citation' will copy column citations.pmid to column qu
alifiers.pmid, which conflicts with relationship(s): 'Descriptor.qualifiers' (copies de
scriptors.pmid to qualifiers.pmid), 'Qualifier.descriptor' (copies descriptors.pmid to 
qualifiers.pmid). Consider applying viewonly=True to read-only relationships, or provid
e a primaryjoin condition marking writable columns with the foreign() annotation.
  for (pr, fr_) in other_props)
venv/lib/python3.4/site-packages/sqlalchemy/orm/relationships.py:2679: SAWarning: relationship 'Citation.qualifiers' will copy column citations.pmid to column qualifiers.pmid, which conflicts with relationship(s): 'Descriptor.qualifiers' (copies descriptors.pmid to qualifiers.pmid), 'Qualifier.descriptor' (copies descriptors.pmid to qualifiers.pmid). Consider applying viewonly=True to read-only relationships, or provide a primaryjoin condition marking writable columns with the foreign() annotation.
  for (pr, fr_) in other_props)
venv/lib/python3.4/site-packages/sqlalchemy/orm/relationships.py:2679: SAWarning: relationship 'Section.abstract' will copy column abstracts.pmid to column sections.pmid, which conflicts with relationship(s): 'Section.citation' (copies citations.pmid to sections.pmid), 'Citation.sections' (copies citations.pmid to sections.pmid). Consider applying viewonly=True to read-only relationships, or provide a primaryjoin condition marking writable columns with the foreign() annotation.
  for (pr, fr_) in other_props)
venv/lib/python3.4/site-packages/sqlalchemy/orm/relationships.py:2679: SAWarning: relationship 'Abstract.sections' will copy column abstracts.pmid to column sections.pmid, which conflicts with relationship(s): 'Section.citation' (copies citations.pmid to sections.pmid), 'Citation.sections' (copies citations.pmid to sections.pmid). Consider applying viewonly=True to read-only relationships, or provide a primaryjoin condition marking writable columns with the foreign() annotation.
  for (pr, fr_) in other_props)
fnl commented 8 years ago

Given that this DB is used only in "write-once and append" mode, this isn't a terribly big problem. However, adding the foreign() annotation to the various pmid columns in the composite keys of the weak entity tables would get rid of the warning, I assume.