-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add logic to search OMERO.tables on non Pythonic named columns #287
Conversation
String columns can be stored using non-pythonic names (spaces, brackets) but their column index cannot simply be used for of a search condition. Instead, a variable can be substituted and mapped using the condvars dictionary.
This is not what the test does |
PR description updated although the primary issue is rather at the level of the I would also be of the opinion of lowering the exposition of these types for consumers of the API if possible. What are the viable options? |
A gateway method would be able to add a call to |
Thoughts on getting this out with #292? |
Answering #287 (comment) specifically, from a code perspective, I think the change here should be fairly harmless and releasable immediately. The PyTables API expectation is that the As discussed earlier this morning, I do not know of any immediate need for this fix so it probably makes sense to allow more time for the review of this PR alongside the examples and some technical documentation explaining its impact for API consumers. |
This pull request has been mentioned on Image.sc Forum. There might be relevant details there: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, lgtm. I haven't been able to come with a scenario where I think existing code would be unhappy (and I also don't think there's too much of that)
See ome/omero-metadata#57 for the reference issue.
OMERO.tables HDF storage uses PyTables querying capabilities in particular the
tables.get_where_list
API. This API takes as a primary input a condition which syntax is defined as in https://www.pytables.org/usersguide/condition_syntax.html.Columns named in a Python compliant way (i.e. matching
^[a-zA-Z_][a-zA-Z0-9_]*$
), the column name can directly be used in the condition e.g.foo>1
. Column names that do not match this patterns e.g. including spaces or brackets are supported but they need to be retrieved usinggetattr
and they cannot directly used as an input condition. As it stands, this prevents the API from querying all the row based on a condition including such a column.350dbc1 demonstrates how to use
condvars
and variable substitution to allow searching these non Pythonic named columns. ae5ca40 proposes to expand the semantics of thevariables
argument oftables.get_where_list
to support these queries remotely. Any string/string key value pair is expanded as a string/column key/pair and passed to the underlyingget_where_list
API allowing variable substitution.Using the OMERO API, this should allow the following types of queries