materialsproject / maggma

MongoDB aggregation machine

Home Page:https://materialsproject.github.io/maggma/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: Bad Warning in Builders

shyamd opened this issue · comments

MapBuilder, GroupBuilder, and ProjectionBuilder all have this ensure index warning that is not a good description of what actually went "wrong". It basically warns that one double index is missing when in fact the check is for all relevant indexes: key, last_updated and state; these are also not double indexes. Would be good to update the warning. Here is the linked code:

if not all(index_checks):
self.logger.warning(
"Missing one or more important indices on stores. "
"Performance for large stores may be severely degraded. "
"Ensure indices on target.key and "
"[(store.last_updated_field, -1), (store.key, 1)] "
"for each of source and target."
)