nextstrain / augur

Pipeline components for real-time phylodynamic analysis
https://docs.nextstrain.org/projects/augur/
GNU Affero General Public License v3.0
268 stars 128 forks source link

merge: Uncaught error with user-defined `.sqliterc` #1603

Closed victorlin closed 3 months ago

victorlin commented 3 months ago

Current Behavior

Presence of a user-defined .sqliterc file can cause augur merge to fail with uncaught exceptions.

Expected behavior

Functionality of augur merge should not be affected by user-defined .sqliterc files.

How to reproduce

  1. Add this to a .sqliterc file

    .mode column
  2. Run any valid augur merge command, for example cram tests/functional/merge/cram/merge.t

  3. Observe error

    Traceback (most recent call last):
      File "augur/tests/functional/merge/cram/../../../../augur/__init__.py", line 70, in run
        return args.__command__.run(args)
      File "augur/tests/functional/merge/cram/../../../../augur/merge.py", line 181, in run
        assert m.columns == (table_columns := sqlite3_table_columns(db_path, m.table_name)), \
    AssertionError: ['strain', 'a', 'b', 'c'] == ['name  ', '------', 'strain', 'a     ', 'b     ', 'c     ']
    
    An error occurred (see above) that has not been properly handled by Augur.
    To report this, please open a new issue including the original command and the error above:
        <https://github.com/nextstrain/augur/issues/new/choose>

Possible solutions

  1. Ignore .sqliterc files entirely and fall back to SQLite3 defaults.
  2. Set explicit config (e.g. .mode list) for commands that could be affected.

Your environment: if running Nextstrain locally

tsibley commented 3 months ago

Potential fix in https://github.com/nextstrain/augur/pull/1608