Skip to content

Conversation

@davidvng
Copy link
Collaborator

  • Renames and adds fields to AtomicMapCoaddTable
  • Adds CoaddMapToCoaddTable link table and related fields to AtomicMapCoaddTable

@JBorrow
Copy link
Member

JBorrow commented Dec 18, 2025

You should use alembic to create your table definitions: https://github.com/simonsobs/mapcat/tree/main/mapcat/alembic

Copy link
Member

@JBorrow JBorrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also need tests for these scenarios to check that the joins are all working, see https://github.com/simonsobs/mapcat/blob/main/tests/test_mapcat.py

Comment on lines +39 to +42
sa_relationship_kwargs={
"primaryjoin": "AtomicMapCoaddTable.coadd_id == CoaddMapToCoaddTable.parent_coadd_id",
"secondaryjoin": "AtomicMapCoaddTable.coadd_id == CoaddMapToCoaddTable.child_coadd_id",
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't fully understand why these manual join relationships are necessary

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get this error if I omit those lines:

AmbiguousForeignKeysError: Could not determine join condition between parent/child tables on relationship AtomicMapCoaddTable.child_coadds - there are multiple foreign key paths linking the tables via secondary table 'link_coadd_map_to_coadd'.  Specify the 'foreign_keys' argument, providing a list of those columns which should be counted as containing a foreign key reference from the secondary table to each of the parent and child tables.

@davidvng davidvng requested a review from JBorrow December 22, 2025 18:44
@JBorrow JBorrow merged commit bd1027f into main Dec 24, 2025
5 checks passed
@JBorrow JBorrow deleted the coadd-update branch December 24, 2025 16:36
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.

3 participants