DM-53891: Change argument type of reassignDiaSourcesToDiaObjects#133
DM-53891: Change argument type of reassignDiaSourcesToDiaObjects#133andy-slac wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #133 +/- ##
==========================================
- Coverage 84.83% 84.80% -0.04%
==========================================
Files 73 73
Lines 7385 7389 +4
Branches 847 848 +1
==========================================
+ Hits 6265 6266 +1
- Misses 883 886 +3
Partials 237 237 ☔ View full report in Codecov by Sentry. |
26a47c3 to
20221f6
Compare
The method now takes DiaObjectId instead of integer diaObjectId, avoids the need to infer DiaObject partition from DiaSource position.
ca65ab2 to
8d64f3d
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates the APDB API for reassigning DiaSources to DiaObjects by changing reassignDiaSourcesToDiaObjects() to accept DiaObjectId (id + coordinates) instead of a bare integer diaObjectId, avoiding Cassandra-specific partition inference from DiaSource position.
Changes:
- Updated the abstract
Apdb.reassignDiaSourcesToDiaObjects()signature and docstring to useMapping[DiaSourceId, DiaObjectId]. - Updated SQL and Cassandra backend implementations to work with
DiaObjectIdvalues (usingobj.diaObjectIdwhere needed). - Updated unit tests to pass
DiaObjectIdinstances; Cassandra also adds an explicit schema/version guard before writing update-record chunks.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| python/lsst/dax/apdb/tests/_apdb.py | Updates reassignment tests to provide DiaObjectId values instead of ints. |
| python/lsst/dax/apdb/sql/apdbSql.py | Adjusts SQL implementation to accept DiaObjectId and use diaObjectId ints internally. |
| python/lsst/dax/apdb/cassandra/apdbCassandra.py | Uses DiaObjectId directly for new object IDs; adds a guard for missing ApdbUpdateRecordChunks. |
| python/lsst/dax/apdb/apdb.py | Updates the abstract method type signature and parameter documentation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The method now takes DiaObjectId instead of integer diaObjectId, avoids the need to infer DiaObject partition from DiaSource position.