simonsobs / librarian

The HERA Librarian.
BSD 2-Clause "Simplified" License
1 stars 2 forks source link

Implement file searching #31

Closed JBorrow closed 7 months ago

JBorrow commented 7 months ago

Fixes simonsobs/librarian#29

JBorrow commented 7 months ago

TODO: CLI

JBorrow commented 7 months ago

CLI now done

JBorrow commented 7 months ago

@plaplant any thoughts on returning a 404 when we find no files v.s. just returning an empty list?

plaplant commented 7 months ago

@JBorrow is the idea that the only thing to change would be a different return code (i.e., 404 vs. 200), but otherwise the rest is similar? I'm open to that, as long as the webserver makes it clear that the issue is specifically that no files matched the query. For me personally I typically associate a 404 error with "unclear user error", which might not be the most useful result in this case.

JBorrow commented 7 months ago

Yeah, I guess the question is in this scenario:

What should this code be?

I've already ran into a development and testing issue here where I thought I was finding zero results but actually I just mis-spelled the name of the endpoint...

JBorrow commented 7 months ago

I am going to merge this and then refactor the endpoint to return an empty list when nothing is found. That makes the most sense to me. It's not an error for no file to match a search constraint.