-
Notifications
You must be signed in to change notification settings - Fork 6
DM-53310: Implement RFC-1138 changes (solar system tables) #424
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
Conversation
617363b to
0fee2c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rearrange your changes so that diff shows actual differences in SSObject/SSSource tables? With current arrangement it's hard to guess which columns were added or dropped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comparing web pages by eye is hard. We have felis diff, but it is not super user-friendly. @JeremyMcCormick, could we extend felis diff to produce a human-readable summary that ignores table and column re-ordering?
|
There should be no need to prepend commit messages with the name of the schema like Also, I think before merging this can be rebased down to a single commit or maybe just a few. Finally, commit messages should start with an implicit verb like "Fix," "Change," etc. :) |
|
This check failure can be ignored: https://github.com/lsst/sdm_schemas/actions/runs/19615135537/job/56166612401?pr=424 The tool is erroneously identifying one of your columns as a "band column." The band column checker should have a switch for ignoring specific columns - I will make a ticket for this. |
All makes sense -- will do! Right now what you're seeing is a lot of development in progress (may be good to ignore it); I'll squash/rebase at the end into a sensible set of commits. |
e8a0a5d to
a41fdc8
Compare
|
Cleaned up the commits down to three logically distinct ones (though the PR is still showing the entire messy history), rebased to latest main, ready for review & merge. |
|
Minor suggestion: changelog update commit can instead be "Add news fragment". |
|
@andy-slac The ids in apdb.yaml are removed in this PR. If You may want to do that immediately before this is even merged as merging this first could result in a broken weekly release. It is harmless to turn that on if the ids are already there as only missing ones are generated. |
andy-slac
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only looked at apdb.yaml, it looks OK with few questions/comment. As this patch does not really touch anything in APDB tables, we do not need to change version number.
python/lsst/sdm/schemas/apdb.yaml
Outdated
| name: "ApdbSchema" | ||
| "@id": "#apdbSchema" | ||
| version: "9.1.0" | ||
| version: "10.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think we need a new version number, APDB database does not care about Solar System tables, and recent dax_apdb update dropped the only table that existed in APDB. We do not want to force people into doing unnecessary schema upgrades. Once we have sso.yaml we may want to track version changes in that schema, but that depends also on the clients of that schema.
python/lsst/sdm/schemas/apdb.yaml
Outdated
| # FIXME: commented out as it generates a | ||
| # > raise ValueError(f"Dependency cycle in foreign keys: {tables}") | ||
| # exception. Unclear why, but as these aren't used in APDB yet there should be no harm. See: | ||
| # https://rubin-obs.slack.com/archives/C07QJMPRMLJ/p1763919304828269?thread_ts=1763826894.543509&cid=C07QJMPRMLJ | ||
| # for some discussion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can uncomment this already, latest dax_apdb should be fixed.
python/lsst/sdm/schemas/apdb.yaml
Outdated
| - name: idx_SSObject_ssObjectId | ||
| description: Unique index on the ssObjectId column | ||
| columns: | ||
| - "#SSObject.ssObjectId" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ssObjectId is already a primary key, no need for an additional index.
python/lsst/sdm/schemas/apdb.yaml
Outdated
| - name: idx_SSObject_designation | ||
| description: >- | ||
| Unique index on the designation column | ||
| columns: | ||
| - "#SSObject.designation" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want a unique index then you need to define a constraint, not an index, e.g.:
constraints:
- name: unique_SSObject_designation
"@type": Unique
description: ...
columns: ["#SSObject.designation"]
python/lsst/sdm/schemas/apdb.yaml
Outdated
| closeness to the predicted SSO position. If diaSourceId is the | ||
| nearest DiaSource to this SSO prediction, diaSourceDistanceRank=1 | ||
| would be set. If it is the second nearest, it would be 2, etc. | ||
| datatype: int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be short?
| description: This is a set of unique identifier_ids in an array that points to the identification_metadata | ||
| table. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is identification_metadata? What is the encoding for the array (JSON)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We replicate this table from the MPC, and keep the exact schema (and docs) as upstream. This refers to a different table at the MPC, that's not relevant for the queries we're hoping to support with the replica here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are exposing description is schema browser, people may get confused if you mention something that does not exist.
| nullable: false | ||
| ivoa:ucd: meta.id;src | ||
| - name: object_type | ||
| description: Integer to indicate the object type. To be linked (foreign key) to object_type lookup table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no object_type table in this schema.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also a replica from the MPC (including the doc strings). We didn't import object_type (yet) as we don't need it.
python/lsst/sdm/schemas/apdb.yaml
Outdated
| - name: idx_current_identifications_packed_primary_provisional_desig | ||
| description: Unique index on the packed_primary_provisional_designation column | ||
| columns: | ||
| - '#current_identifications.packed_primary_provisional_designation' | ||
| - name: idx_current_identifications_packed_secondary_provisional_desig | ||
| description: Unique index on the packed_secondary_provisional_designation column | ||
| columns: | ||
| - '#current_identifications.packed_secondary_provisional_designation' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unique indices need to be in constraints:. Is each of these columns unique or only their combination?
| ivoa:ucd: time.processing;meta.dataset | ||
| indexes: | ||
| - name: idx_numbered_identifications_iau_name | ||
| description: Unique index on the iau_name column |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same - all unique indices should be constraints.
| - name: SSSource | ||
| description: LSST-computed per-source quantities. 1:1 relationship with DiaSource. | ||
| tap:table_index: 120 | ||
| primaryKey: '#SSSource.diaSourceId' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we prefer double colons everywhere for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The double colons -- you mean as "1::1" or elsewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'm typing without reading - I mean double quotes 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need to convert to double quotes here
This is already on |
878b4ec to
185ff4c
Compare
👍 -- updated to "Add news fragment for RFC-1138 (SS* table) changes". |
78e8a4d to
7b11908
Compare
|
@andy-slac @JeremyMcCormick I think I've implemented all the review comments (thanks!). I also synced up lsstcam.yaml with comments on apdb.yaml that transfer over. Ready to be green-lit for merging? |
Approved! |
7b11908 to
37e6f6d
Compare
isullivan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments on formatting.
| - '#SSObject.designation' | ||
| referencedColumns: | ||
| - '#mpc_orbits.designation' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double quotes?
| - name: SSSource | ||
| description: LSST-computed per-source quantities. 1:1 relationship with DiaSource. | ||
| tap:table_index: 120 | ||
| primaryKey: '#SSSource.diaSourceId' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need to convert to double quotes here
| description: Link an SSSource to its associated DiaSource | ||
| '@type': ForeignKey | ||
| columns: | ||
| - '#SSSource.diaSourceId' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and in the following ~20 lines, use double quotes for quotes in columns
| description: Uniqueness of unpacked_primary_provisional_designation | ||
| '@type': Unique | ||
| columns: | ||
| - '#mpc_orbits.unpacked_primary_provisional_designation' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and the next couple columns, use double quotes
| "@type": Unique | ||
| description: Unique index on the packed_primary_provisional_designation column | ||
| columns: | ||
| - '#current_identifications.packed_primary_provisional_designation' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and next column, double quotes
Also drop "@id" columns which can now be auto-generated.
37e6f6d to
3dc7f48
Compare
Checklist
When making changes to YAML files in the schemas directory: