Skip to content
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

Where queries should support "in" correctly when the left hand is a string #41

Closed
wasade opened this issue Jun 7, 2017 · 0 comments · Fixed by #122
Closed

Where queries should support "in" correctly when the left hand is a string #41

wasade opened this issue Jun 7, 2017 · 0 comments · Fixed by #122

Comments

@wasade
Copy link
Member

wasade commented Jun 7, 2017

$ redbiom search metadata "beer | wine where 'fermented' in sample_type"
Traceback (most recent call last):
  File "/Users/mcdonadt/miniconda3/envs/redbiom/bin/redbiom", line 11, in <module>
    load_entry_point('redbiom', 'console_scripts', 'redbiom')()
  File "/Users/mcdonadt/miniconda3/envs/redbiom/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/mcdonadt/miniconda3/envs/redbiom/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/mcdonadt/miniconda3/envs/redbiom/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/mcdonadt/miniconda3/envs/redbiom/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/mcdonadt/miniconda3/envs/redbiom/lib/python3.5/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/mcdonadt/miniconda3/envs/redbiom/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/mcdonadt/ResearchWork/software/sequence-search/redbiom/commands/search.py", line 87, in search_metadata
    for i in redbiom.search.metadata_full(query, categories):
  File "/Users/mcdonadt/ResearchWork/software/sequence-search/redbiom/search.py", line 56, in metadata_full
    obs = set(redbiom.where_expr.whereeval(q, get=get).index)
  File "/Users/mcdonadt/ResearchWork/software/sequence-search/redbiom/where_expr.py", line 160, in whereeval
    result = eval(ast.dump(formed))
  File "<string>", line 1, in <module>
  File "/Users/mcdonadt/ResearchWork/software/sequence-search/redbiom/where_expr.py", line 135, in Compare
    left = op(left, comp)
  File "/Users/mcdonadt/ResearchWork/software/sequence-search/redbiom/where_expr.py", line 91, in _in
    return left[left.isin(right)]
AttributeError: 'str' object has no attribute 'isin'
``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant