jhu-bids / TermHub

Web app and CLI tools for working with biomedical terminologies. https://github.com/orgs/jhu-bids/projects/9/views/7
https://bit.ly/termhub
GNU General Public License v3.0
10 stars 10 forks source link

Bug: `TestRefreshDatasetGroupTables`: extension not in test schema #792

Open joeflack4 opened 4 months ago

joeflack4 commented 4 months ago

Overview

When running test_load_dataset_group(), The following error arises:

operator class "gin_trgm_ops" does not exist for access method "gin"

Here's my ChatGPT conversation and 2 of the threads I looked through.

I tried all the suggestions that made sense at these links. Everything in my setup seems correct. The extension appears to be enabled in the test schema; in fact for all schema. Search path seems correct. I even reinstalled the extensions (on all schema), and still the error.

Temporary solution

For now, I've added the following try/except in refresh_derived_tables_exec() which will skip creating this index if running on test schema, as it is not necessary.

Python code

```py for statement in statements: try: run_sql(con, statement) except ProgrammingError as err: if schema == 'test_n3c' and 'does not exist for access method' in str(err): print('Warning: A known error occurred while trying to create an extension-based index in the test' ' schema. For now, we\'re skipping creation of this index here as is not necessary for ' 'testing.', file=sys.stderr) continue raise err ```