Skip to content

Commit 99208a9

Browse files
authored
Merge pull request #17 from galaxy-genome-annotation/has_table
Fix has_table error
2 parents 356b1c6 + 7b0d08a commit 99208a9

File tree

5 files changed

+11
-5
lines changed

5 files changed

+11
-5
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
4747
pypi:
4848
runs-on: ubuntu-latest
49+
needs: [lint, py_test]
4950
name: Deploy release to Pypi
5051
steps:
5152
- name: Checkout

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ $ chakin feature load_fasta \
8787
8888
## History
8989
90+
- 2.3.5
91+
- Fix has_table() calls with recent sqlalchemy versions
92+
9093
- 2.3.4
9194
- Now requires biopython >=1.78
9295
- Fixes biopython sequence usage in recent biopython

chado/load/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
from future import standard_library
2323

24-
from sqlalchemy import Column, Float, ForeignKey, Integer, String, Table
24+
from sqlalchemy import Column, Float, ForeignKey, Integer, String, Table, inspect
2525
from sqlalchemy import exc as sa_exc
2626

2727
standard_library.install_aliases()
@@ -824,7 +824,7 @@ def _setup_tables(self, module):
824824
self.ci.create_cvterm(term='analysis_blast_output_iteration_hits', term_definition='Hits of a blast', cv_name='tripal', db_name='tripal')
825825
# Tables for blast
826826
added_table = False
827-
if not self.engine.dialect.has_table(self.engine, 'tripal_analysis_blast', schema='public'):
827+
if not inspect(self.engine).has_table('tripal_analysis_blast', schema='public'):
828828
tripal_analysis_blast_table = Table(
829829
'tripal_analysis_blast', self.metadata,
830830
Column('db_id', Integer, primary_key=True, nullable=False, default=0, index=True),
@@ -839,7 +839,7 @@ def _setup_tables(self, module):
839839
tripal_analysis_blast_table.create(self.engine)
840840
added_table = True
841841

842-
if not self.engine.dialect.has_table(self.engine, 'blast_organisms', schema=self.ci.dbschema):
842+
if not inspect(self.engine).has_table('blast_organisms', schema=self.ci.dbschema):
843843
blast_organisms_table = Table(
844844
'blast_organisms', self.metadata,
845845
Column('blast_org_id', Integer, primary_key=True, nullable=False),
@@ -855,7 +855,7 @@ def _setup_tables(self, module):
855855
self.ci._reflect_tables()
856856
self.model = self.ci.model
857857

858-
if not self.engine.dialect.has_table(self.engine, 'blast_hit_data', schema=self.ci.dbschema):
858+
if not inspect(self.engine).has_table('blast_hit_data', schema=self.ci.dbschema):
859859
blast_hit_data_table = Table(
860860
'blast_hit_data', self.metadata,
861861
Column('analysisfeature_id', Integer, ForeignKey(self.model.analysisfeature.analysisfeature_id, ondelete="CASCADE"), nullable=False, index=True, primary_key=True),

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'chado'))
77

8+
project = "Python-chado"
9+
810
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon']
911
master_doc = 'index'
1012

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name="chado",
9-
version='2.3.4',
9+
version='2.3.5',
1010
description="Chado library",
1111
author="Anthony Bretaudeau",
1212
author_email="[email protected]",

0 commit comments

Comments
 (0)