-
Notifications
You must be signed in to change notification settings - Fork 6
updates for mongo embedded #22
base: master
Are you sure you want to change the base?
Conversation
@@ -118,14 +118,14 @@ def get_header_field(field): | |||
if field[0:6] == 'count_': | |||
return 0 | |||
else: | |||
return None | |||
return {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Under what circumstances would this codepath be hit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example could be. If a run doesn't have a stop document and you ask for the stop document
intake_bluesky/mongo_embedded.py
Outdated
@@ -278,7 +278,8 @@ def search(self, query): | |||
MongoDB query. | |||
""" | |||
if query: | |||
query = {f"start.{key}": val for key, val in query.items()} | |||
query = {f"start.{key}".replace("start.$", "$", 1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is sufficient to pass the tests, but our test coverage is lacking. What about a query like {'$and', [{'detector': 'pe1}, {'motor': {'$in': ['motor_A', 'motor_B']}}]}
? I think the general solution here will either be to have separate RunStart collection that we treat as a disposable cache or discover a general strategy for transforming queries that are constructed to operate on a collection into queries that operate on a sub-field of documents in that collection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I added a decent general solution.
…use volatile_db anymore
Power-cycled to re-run tests. |
No description provided.