aitgon / vtam

MIT License
3 stars 3 forks source link

sqlalchemy.exc.ArgumentError with latest sqlachemy version (v2.0.4) #31

Closed KevCaz closed 1 year ago

KevCaz commented 1 year ago

Hello there,

FWIW I ran into the following problem when I was running the snake example.

$ vtam filter --db asper1/db.sqlite --sortedinfo asper1/run1_mfzr/sorted/sortedinfo.tsv --sorteddir $(dirname asper1/run1_mfzr/sorted/sortedinfo.tsv) --asvtable asper1/run1_mfzr/asvtable_default.tsv -v --log asper1/vtam.log
Traceback (most recent call last):
  File "/home/kc/miniconda3/envs/vtam/bin/vtam", line 8, in <module>
    sys.exit(main())
  File "/home/kc/miniconda3/envs/vtam/lib/python3.9/site-packages/vtam/__init__.py", line 308, in main
    VTAM(sys.argv[1:])
  File "/home/kc/miniconda3/envs/vtam/lib/python3.9/site-packages/vtam/__init__.py", line 158, in __init__
    CommandFilterOptimize.main(arg_parser_dic=arg_parser_dic)
  File "/home/kc/miniconda3/envs/vtam/lib/python3.9/site-packages/vtam/CommandFilterOptimize.py", line 37, in main
    sqlalchemy.select([filter_lfn_reference.c.filter_id]).where(
  File "/home/kc/miniconda3/envs/vtam/lib/python3.9/site-packages/sqlalchemy/sql/_selectable_constructors.py", line 493, in select
    return Select(*entities)
  File "/home/kc/miniconda3/envs/vtam/lib/python3.9/site-packages/sqlalchemy/sql/selectable.py", line 5160, in __init__
    self._raw_columns = [
  File "/home/kc/miniconda3/envs/vtam/lib/python3.9/site-packages/sqlalchemy/sql/selectable.py", line 5161, in <listcomp>
    coercions.expect(
  File "/home/kc/miniconda3/envs/vtam/lib/python3.9/site-packages/sqlalchemy/sql/coercions.py", line 413, in expect
    resolved = impl._literal_coercion(
  File "/home/kc/miniconda3/envs/vtam/lib/python3.9/site-packages/sqlalchemy/sql/coercions.py", line 652, in _literal_coercion
    self._raise_for_expected(element, argname)
  File "/home/kc/miniconda3/envs/vtam/lib/python3.9/site-packages/sqlalchemy/sql/coercions.py", line 1143, in _raise_for_expected
    return super()._raise_for_expected(
  File "/home/kc/miniconda3/envs/vtam/lib/python3.9/site-packages/sqlalchemy/sql/coercions.py", line 711, in _raise_for_expected
    super()._raise_for_expected(
  File "/home/kc/miniconda3/envs/vtam/lib/python3.9/site-packages/sqlalchemy/sql/coercions.py", line 536, in _raise_for_expected
    raise exc.ArgumentError(msg, code=code) from err
sqlalchemy.exc.ArgumentError: Column expression, FROM clause, or other columns clause element expected, got [Column('filter_id', Integer(), table=<FilterLFNreference>, primary_key=True, nullable=False)]. Did you mean to say select(Column('filter_id', Integer(), table=<FilterLFNreference>, primary_key=True, nullable=False))?

I switched to a previous version of sqlachemy (I did not try to find out the latest working version, I assume it is related with the new major release 2.x.x version) and it solved the issue.

conda install sqlalchemy=1.4.39

I just thought this could help other people. Anyway, thanks for your work on this.

aitgon commented 1 year ago

Thank you for the issue. I fixed sqlalchemy 1.4 in the requirements to avoid this problem. In case this is useful, I propose a singularity container as the safest method for installation: https://github.com/aitgon/vtam/tree/develop