HERA-Team / librarian

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

Search instances returning whole database from python #54

Closed KingsleyWeb closed 6 years ago

KingsleyWeb commented 6 years ago

https://github.com/HERA-Team/librarian/blob/95ea2e9f244b3f3be0d97aa6ca3c59660b294de0/hera_librarian/__init__.py#L291

I'm wondering if there's been a change to the SQL somewhere? here's an example of what works and what doesn't, files are fine, instances not, works from the web interface still though, which is puzzling

import hera_librarian
import json
client = hera_librarian.LibrarianClient("local")

#this works
output = client.search_files(search='{ "name-matches": "zen.2458042.14043.xx.HH.uv" }')["results"]
print output

#this seems to return everything in the database
output = client.search_instances(search='{ "name-matches": "zen.2458042.14043.xx.HH.uv" }')["results"]
print output
pkgw commented 6 years ago

Whooooa well that code path was certainly never tested!

This should be fixed as of the 0.1.6 release that I just made, which is now running at NRAO.