-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for metadata filter suggestions in the web UI #493
Comments
Afterthought to 1.: in #487 we decided to use |
This seems fine to me. The rest of the issue also seems fine to me - let's leave |
Maybe a combination of both is a good solution?
@blakerosenthal this might also be a good solution for 1. #495 (comment) when using the JSON approach. |
Makes sense, I'll implement this. |
In #484 we hardcode the available metadata. We cannot release with that. Instead we need a way to communicate this information from the backend to the web UI. For this we need
An endpoint on the API, i.e.
GET /corpuses/{name}/metadata
A new abstract method on the
SourceStorage
class, e.g.list_metadata
(name TBD). The return value should bedict[str, tuple[type, list[Any]]]
with the keys being the available metadata keys and the values being a two-tuple of the type and the available values.type
above might also be astr
, e.g."int"
,"float"
, etc., if that makes it easier.This function is potentially pretty expensive as one has to query the full database and potentially extract unique values from it. Thus, while we don't need to have it from the first version, we should have caching in mind.
Lastly, I'm not sure yet if we want to make it a strictly abstract, i.e. decorating with
@abstractmethod
, because that would require everyone to implement this even if one doesn't want to work with corpuses. Instead we could also leave it undecorated andraise NotImplementedError
instead and thus pushing the check to runtime. Thoughts?In addition, 2. also has to be implemented on builtin source storages.
The text was updated successfully, but these errors were encountered: