bluesky / databroker

Unified API pulling data from multiple sources
https://blueskyproject.io/databroker
BSD 3-Clause "New" or "Revised" License
35 stars 46 forks source link

Added distinct to MongoAdapter in experimental code #763

Closed jmaruland closed 1 year ago

jmaruland commented 1 year ago

This includes the implementation of nested search() queries before a distinct() request

danielballan commented 1 year ago

This does separate queries for getting the list of distinct values and their counts. Given the experimental and temporary status of this code, that is good enough for now. For the record---in case we want it later---I will link this Stack Overflow post describing how to obtain both in a single query: https://stackoverflow.com/a/33418582/1221924

jmaruland commented 1 year ago

With the previous commit (https://github.com/bluesky/databroker/pull/763/commits/c345fc5b47b41387bb61d67a6579c6536f3d01ad), I improved the way specs is requested with distinct in the mongo database and it returns a similar behavior that we can see in the base code of tiled and that is also referenced in https://github.com/bluesky/tiled/pull/436

danielballan commented 1 year ago

Power-cycled to re-run tests. This was failing due to an upstream issue in vcrpy that seems to have been resolved by their latest release.