Skip to content

DM-53891: Change argument type of reassignDiaSourcesToDiaObjects#133

Open
andy-slac wants to merge 2 commits into
mainfrom
tickets/DM-53891
Open

DM-53891: Change argument type of reassignDiaSourcesToDiaObjects#133
andy-slac wants to merge 2 commits into
mainfrom
tickets/DM-53891

Conversation

@andy-slac

Copy link
Copy Markdown
Collaborator

The method now takes DiaObjectId instead of integer diaObjectId, avoids the need to infer DiaObject partition from DiaSource position.

@codecov

codecov Bot commented Jan 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.80%. Comparing base (8573ff4) to head (8d64f3d).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
python/lsst/dax/apdb/cassandra/apdbCassandra.py 60.00% 1 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

andy-slac added 2 commits May 19, 2026 14:22
The method now takes DiaObjectId instead of integer diaObjectId,
avoids the need to infer DiaObject partition from DiaSource position.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 use Mapping[DiaSourceId, DiaObjectId].
  • Updated SQL and Cassandra backend implementations to work with DiaObjectId values (using obj.diaObjectId where needed).
  • Updated unit tests to pass DiaObjectId instances; 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.

Comment thread python/lsst/dax/apdb/apdb.py
Comment thread python/lsst/dax/apdb/cassandra/apdbCassandra.py
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.

2 participants