Skip to content
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

DM-41639: Allow Apdb queries for visit completion #40

Merged
merged 2 commits into from Nov 10, 2023
Merged

Conversation

kfindeisen
Copy link
Member

This PR adds two methods for querying the presence of a visit-detector on an APDB. The first, Apdb.contains, is the preferred long-term solution, but cannot be implemented without schema changes. The second, ApdbSql.containsCcdVisit, can work right away but requires arguments that are not compatible with contains (and cannot be efficiently implemented in Cassandra).

The Jira issue(s) that would allow containsCcdVisit to be retired in favor of contains should be defined before this PR is merged.

@kfindeisen kfindeisen force-pushed the tickets/DM-41639 branch 2 times, most recently from bf2faf1 to 3c1342a Compare November 8, 2023 02:09
@kfindeisen kfindeisen marked this pull request as ready for review November 8, 2023 21:22
Copy link
Collaborator

@andy-slac andy-slac left a comment

Choose a reason for hiding this comment

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

Looks good, few minor comments.

python/lsst/dax/apdb/apdb.py Outdated Show resolved Hide resolved
python/lsst/dax/apdb/apdb.py Outdated Show resolved Hide resolved
python/lsst/dax/apdb/apdbSql.py Outdated Show resolved Hide resolved
python/lsst/dax/apdb/apdbSql.py Outdated Show resolved Hide resolved
python/lsst/dax/apdb/tests/_apdb.py Outdated Show resolved Hide resolved
This method allows tests of whether a particular visit-detector has already
been stored in the APDB.
This method does the same thing as Apdb.containsVisitDetector, but
takes as input a "packed" visit-detector ID instead of separate visit
and detector IDs.

This alternative is necessary because, at present, the packed ID is the
only form of the information in the database, and the packing process
requires information that dax.apdb.Apdb should not have access to.
containsCcdVisit can be replaced with contains once either a dedicated
table is created, or Dia*Source use visit and detector internally.
@kfindeisen kfindeisen merged commit cb20ee0 into main Nov 10, 2023
5 checks passed
@kfindeisen kfindeisen deleted the tickets/DM-41639 branch November 10, 2023 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants