fix for duplicate singleinspiral queries
The base Event
class can have one or more child classes, based on whatever event upload it might be. For example, for CBC pipelines there is a CoincInspiral
child class and one or more SingleInspiral
child classes, depending on the number of single inspiral tables in the upload (one corresponding to each IFO). SingleInspiral
is the only subclass that might have multiple entries corresponding to one Event
.
When a user queries for a single inspiral property (like a channel name), GraceDB searches across the SingleInspiral
event classes and then returns the parent Event
of the SingleInspiral
subclass that meets the query criteria. An unintended consequence of removing the .distinct()
on all search results in !241 (merged) was introducing duplicate results for queries that contained single inspiral properties.
For example, a user queries for events that contain a singleinspiral.channel
name. The same channel name is present for the L1 and H1 single inspiral tables, and so GraceDB would return the same parent Event
twice. This fix adds a check to see if the query contains single inspiral properties, and if so, run a .distinct()
on results before returning results to the user.
This has been tested in the browser and with the API, and has been running on gracedb-playground/test/dev
since Dec. 20th