pacificclimate / modelmeta

An ORM representation of the model metadata database
GNU General Public License v3.0
1 stars 0 forks source link

sqlalchemy overlap warning #110

Open corviday opened 3 years ago

corviday commented 3 years ago

SQLAlchemy gives the following warnings when interacting with the most recent version of the modelmeta ORM:

/local_temp/lzeman/modelmeta/venv/lib64/python3.6/site-packages/sqlalchemy/orm/relationships.py:3454: SAWarning: relationship 'DataFileVariableDSGTimeSeriesXStation.data_file_variable_dsg_ts' will copy column data_file_variables_dsg_time_series.data_file_variable_dsg_ts_id to column data_file_variables_dsg_time_series_x_stations.data_file_variable_dsg_ts_id, which conflicts with relationship(s): 'DataFileVariableDSGTimeSeries.stations' (copies data_file_variables_dsg_time_series.data_file_variable_dsg_ts_id to data_file_variables_dsg_time_series_x_stations.data_file_variable_dsg_ts_id), 'Station.data_file_variables' (copies data_file_variables_dsg_time_series.data_file_variable_dsg_ts_id to data_file_variables_dsg_time_series_x_stations.data_file_variable_dsg_ts_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.   The 'overlaps' parameter may be used to remove this warning.
  for (pr, fr_) in other_props
/local_temp/lzeman/modelmeta/venv/lib64/python3.6/site-packages/sqlalchemy/orm/relationships.py:3454: SAWarning: relationship 'DataFileVariableDSGTimeSeriesXStation.station' will copy column stations.station_id to column data_file_variables_dsg_time_series_x_stations.station_id, which conflicts with relationship(s): 'DataFileVariableDSGTimeSeries.stations' (copies stations.station_id to data_file_variables_dsg_time_series_x_stations.station_id), 'Station.data_file_variables' (copies stations.station_id to data_file_variables_dsg_time_series_x_stations.station_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.   The 'overlaps' parameter may be used to remove this warning.
  for (pr, fr_) in other_props
/local_temp/lzeman/modelmeta/venv/lib64/python3.6/site-packages/sqlalchemy/orm/relationships.py:3454: SAWarning: relationship 'DataFile.run' will copy column runs.run_id to column data_files.run_id, which conflicts with relationship(s): 'Run.time_set' (copies runs.run_id to data_files.run_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.   The 'overlaps' parameter may be used to remove this warning.
  for (pr, fr_) in other_props
/local_temp/lzeman/modelmeta/venv/lib64/python3.6/site-packages/sqlalchemy/orm/relationships.py:3454: SAWarning: relationship 'Run.files' will copy column runs.run_id to column data_files.run_id, which conflicts with relationship(s): 'Run.time_set' (copies runs.run_id to data_files.run_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.   The 'overlaps' parameter may be used to remove this warning.
  for (pr, fr_) in other_props
/local_temp/lzeman/modelmeta/venv/lib64/python3.6/site-packages/sqlalchemy/orm/relationships.py:3454: SAWarning: relationship 'DataFile.timeset' will copy column time_sets.time_set_id to column data_files.time_set_id, which conflicts with relationship(s): 'Run.time_set' (copies time_sets.time_set_id to data_files.time_set_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.   The 'overlaps' parameter may be used to remove this warning.
  for (pr, fr_) in other_props
/local_temp/lzeman/modelmeta/venv/lib64/python3.6/site-packages/sqlalchemy/orm/relationships.py:3454: SAWarning: relationship 'TimeSet.files' will copy column time_sets.time_set_id to column data_files.time_set_id, which conflicts with relationship(s): 'Run.time_set' (copies time_sets.time_set_id to data_files.time_set_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.   The 'overlaps' parameter may be used to remove this warning.
  for (pr, fr_) in other_props
/local_temp/lzeman/modelmeta/venv/lib64/python3.6/site-packages/sqlalchemy/orm/relationships.py:3454: SAWarning: relationship 'Variable.data_files_variables' will copy column variable_aliases.variable_alias_id to column variables.variable_alias_id, which conflicts with relationship(s): 'Variable.variable_aliases' (copies variable_aliases.variable_alias_id to variables.variable_alias_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.   The 'overlaps' parameter may be used to remove this warning.
  for (pr, fr_) in other_props
/local_temp/lzeman/modelmeta/venv/lib64/python3.6/site-packages/sqlalchemy/orm/relationships.py:3454: SAWarning: relationship 'DataFileVariable.variable_alias' will copy column variable_aliases.variable_alias_id to column data_file_variables.variable_alias_id, which conflicts with relationship(s): 'Variable.data_files_variables' (copies variable_aliases.variable_alias_id to data_file_variables.variable_alias_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.   The 'overlaps' parameter may be used to remove this warning.
  for (pr, fr_) in other_props
/local_temp/lzeman/modelmeta/venv/lib64/python3.6/site-packages/sqlalchemy/orm/relationships.py:3454: SAWarning: relationship 'VariableAlias.data_file_variables' will copy column variable_aliases.variable_alias_id to column data_file_variables.variable_alias_id, which conflicts with relationship(s): 'Variable.data_files_variables' (copies variable_aliases.variable_alias_id to data_file_variables.variable_alias_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.   The 'overlaps' parameter may be used to remove this warning.
  for (pr, fr_) in other_props
/local_temp/lzeman/modelmeta/venv/lib64/python3.6/site-packages/sqlalchemy/orm/relationships.py:3454: SAWarning: relationship 'DataFile.variable_aliases' will copy column data_files.data_file_id to column data_file_variables.data_file_id, which conflicts with relationship(s): 'DataFileVariable.file' (copies data_files.data_file_id to data_file_variables.data_file_id), 'DataFile.data_file_variables' (copies data_files.data_file_id to data_file_variables.data_file_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.   The 'overlaps' parameter may be used to remove this warning.
  for (pr, fr_) in other_props
/local_temp/lzeman/modelmeta/venv/lib64/python3.6/site-packages/sqlalchemy/orm/relationships.py:3454: SAWarning: relationship 'DataFile.variable_aliases' will copy column variable_aliases.variable_alias_id to column data_file_variables.variable_alias_id, which conflicts with relationship(s): 'Variable.data_files_variables' (copies variable_aliases.variable_alias_id to data_file_variables.variable_alias_id), 'DataFileVariable.variable_alias' (copies variable_aliases.variable_alias_id to data_file_variables.variable_alias_id), 'VariableAlias.data_file_variables' (copies variable_aliases.variable_alias_id to data_file_variables.variable_alias_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.   The 'overlaps' parameter may be used to remove this warning.
  for (pr, fr_) in other_props
/local_temp/lzeman/modelmeta/venv/lib64/python3.6/site-packages/sqlalchemy/orm/relationships.py:3454: SAWarning: relationship 'VariableAlias.data_files' will copy column variable_aliases.variable_alias_id to column data_file_variables.variable_alias_id, which conflicts with relationship(s): 'Variable.data_files_variables' (copies variable_aliases.variable_alias_id to data_file_variables.variable_alias_id), 'DataFileVariable.variable_alias' (copies variable_aliases.variable_alias_id to data_file_variables.variable_alias_id), 'VariableAlias.data_file_variables' (copies variable_aliases.variable_alias_id to data_file_variables.variable_alias_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.   The 'overlaps' parameter may be used to remove this warning.
  for (pr, fr_) in other_props
/local_temp/lzeman/modelmeta/venv/lib64/python3.6/site-packages/sqlalchemy/orm/relationships.py:3454: SAWarning: relationship 'VariableAlias.data_files' will copy column data_files.data_file_id to column data_file_variables.data_file_id, which conflicts with relationship(s): 'DataFileVariable.file' (copies data_files.data_file_id to data_file_variables.data_file_id), 'DataFile.data_file_variables' (copies data_files.data_file_id to data_file_variables.data_file_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.   The 'overlaps' parameter may be used to remove this warning.
  for (pr, fr_) in other_props
/local_temp/lzeman/modelmeta/venv/lib64/python3.6/site-packages/sqlalchemy/orm/relationships.py:3454: SAWarning: relationship 'Variable.variable_alias' will copy column variable_aliases.variable_alias_id to column variables.variable_alias_id, which conflicts with relationship(s): 'Variable.variable_aliases' (copies variable_aliases.variable_alias_id to variables.variable_alias_id), 'Variable.data_files_variables' (copies variable_aliases.variable_alias_id to variables.variable_alias_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.   The 'overlaps' parameter may be used to remove this warning.
  for (pr, fr_) in other_props
/local_temp/lzeman/modelmeta/venv/lib64/python3.6/site-packages/sqlalchemy/orm/relationships.py:3454: SAWarning: relationship 'VariableAlias.variable' will copy column variable_aliases.variable_alias_id to column variables.variable_alias_id, which conflicts with relationship(s): 'Variable.variable_aliases' (copies variable_aliases.variable_alias_id to variables.variable_alias_id), 'Variable.data_files_variables' (copies variable_aliases.variable_alias_id to variables.variable_alias_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.   The 'overlaps' parameter may be used to remove this warning.
  for (pr, fr_) in other_props

Looks like there are some fancy flags we should set to handle the split between gridded datasets and discrete structured geometry datasets.

I didn't see these warnings last week, so they may represent some new sqlalchemy functionality. It looiks like a new version was released today, and we haven't pinned. Solution may be either researching the fancy new flags and applying as indicated, or pinning to an older version.

rod-glover commented 3 years ago

Ick. Pin it first. Investigate and correct later, possibly.

rod-glover commented 3 years ago

See https://github.com/pacificclimate/pycds/issues/94 and https://github.com/pacificclimate/pycds/pull/101 for the fix to this.