biocore / redbiom

Sample search by metadata and features
Other
44 stars 20 forks source link

Bug in version up on pip and conda #107

Closed BenKaehler closed 2 years ago

BenKaehler commented 3 years ago

There seems to be a bug in the redbiom that is available on pip or conda (conda-forge). An example follows. If I clone the repo and pip install it, it works. I note that the versions are the same (0.3.5), so I'm note sure what's gone wrong.

This is all in the context of the current qiime2 installation.

Thanks!

$ redbiom search metadata "where empo_3 == 'Plant surface'"
Traceback (most recent call last):
  File "/home/ben/miniconda3/envs/qiime2-update-clawback/bin/redbiom", line 10, in <module>
    sys.exit(cli())
  File "/home/ben/miniconda3/envs/qiime2-update-clawback/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/ben/miniconda3/envs/qiime2-update-clawback/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/ben/miniconda3/envs/qiime2-update-clawback/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ben/miniconda3/envs/qiime2-update-clawback/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/ben/miniconda3/envs/qiime2-update-clawback/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/ben/miniconda3/envs/qiime2-update-clawback/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/ben/miniconda3/envs/qiime2-update-clawback/lib/python3.8/site-packages/redbiom/commands/search.py", line 120, in search_metadata
    for i in redbiom.search.metadata_full(query, categories):
  File "/home/ben/miniconda3/envs/qiime2-update-clawback/lib/python3.8/site-packages/redbiom/search.py", line 60, in metadata_full
    obs = set(redbiom.where_expr.whereeval(q, get=get).index)
  File "/home/ben/miniconda3/envs/qiime2-update-clawback/lib/python3.8/site-packages/redbiom/where_expr.py", line 178, in whereeval
    result = eval(ast.dump(formed))
  File "<string>", line 1, in <module>
NameError: name 'Constant' is not defined
wasade commented 3 years ago

I believe this was observed and fixed in #94, could you verify?

BenKaehler commented 3 years ago

Thanks @wasade, it looks like the same bug, but the only fix I can see in #94 is limiting the Python version, which is a pain if you want to use the latest QIIME 2 release.

The fix that I found (and I've confirmed it works for the same queries they were having trouble with in #94) is to pip-install redbiom from source, for some reason. That works with Python 3.8.8.

I tried to rebuild the conda package to see if that might help but I ran out of time after the n-th broken conda build.

wasade commented 3 years ago

Good point, I didn't catch that Q2 moved to py38. Doesn't #97 solve this (granted we need to unpin CI)? It sounds like the path of least resistance is a rebuild of the conda package?

BenKaehler commented 3 years ago

Thanks, I didn't notice #97. I would guess that #97 is why it works when I install from source, so hopefully a conda rebuild will fix it. I will try again when I get a chance. We should increment the third version number as well.

wasade commented 3 years ago

Ya certainly w/ version...

On Aug 18, 2021, at 12:37 PM, Ben Kaehler @.***> wrote:

Thanks, I didn't notice #97 https://github.com/biocore/redbiom/pull/97. I would guess that #97 https://github.com/biocore/redbiom/pull/97 is why it works when I install from source, so hopefully a conda rebuild will fix it. I will try again when I get a chance. We should increment the third version number as well.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/biocore/redbiom/issues/107#issuecomment-901378246, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADTZMQTUUHJGNTL5CZ6GXDT5QDZNANCNFSM5CHBWRWA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email.