Skip to content
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.

updates for mongo embedded #22

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

updates for mongo embedded #22

wants to merge 7 commits into from

Conversation

gwbischof
Copy link
Collaborator

No description provided.

@gwbischof gwbischof requested a review from danielballan April 25, 2019 22:01
intake_bluesky/mongo_embedded.py Outdated Show resolved Hide resolved
@@ -118,14 +118,14 @@ def get_header_field(field):
if field[0:6] == 'count_':
return 0
else:
return None
return {}
Copy link
Member

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?

Copy link
Collaborator Author

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

@@ -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):
Copy link
Member

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.

Copy link
Collaborator Author

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.

@danielballan danielballan reopened this May 7, 2019
@danielballan
Copy link
Member

Power-cycled to re-run tests.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants