maggma icon indicating copy to clipboard operation
maggma copied to clipboard

Ensure indices seems to fail silently with read_only credentials

Open mkhorton opened this issue 6 years ago • 6 comments

Another bare try/except!

mkhorton avatar Oct 08 '18 19:10 mkhorton

So there is a true/false return with the intention that if it can't ensure the index it will just return false.

Is there another situation that might not fit in this paradigm?

shyamd avatar Dec 12 '18 19:12 shyamd

well, yes, I wasn't checking the return types :) I just ran the function and it executed and moved onto the next line, I didn't realize it hadn't worked

mkhorton avatar Dec 12 '18 19:12 mkhorton

Ok. Sounds like it's not an issue then.

shyamd avatar Dec 12 '18 19:12 shyamd

passive-aggressively reopens issue it's definitely an issue, it should raise an exception if it can't ensure the index!

mkhorton avatar Dec 12 '18 19:12 mkhorton

Specifically, these lines: https://github.com/materialsproject/maggma/blob/1f875fc66567cfa8dc08d30f606d5062c5827bef/maggma/stores.py#L257-L261

create_index already raises the appropriate exceptions, but we're silently catching them and just returning False instead, I don't think that's a great idea?

mkhorton avatar Dec 12 '18 19:12 mkhorton

Ok, re-opened. My reason for that behavior is that usually not having an index will not halt the operation, but merely slow it down.

I leave this issue open for debate.

shyamd avatar Dec 12 '18 19:12 shyamd