Skip to content

Commit

Permalink
Merge pull request #17 from galaxy-genome-annotation/has_table
Browse files Browse the repository at this point in the history
Fix has_table error
  • Loading branch information
abretaud committed Apr 30, 2021
2 parents 356b1c6 + 7b0d08a commit 99208a9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ jobs:
pypi:
runs-on: ubuntu-latest
needs: [lint, py_test]
name: Deploy release to Pypi
steps:
- name: Checkout
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ $ chakin feature load_fasta \
## History
- 2.3.5
- Fix has_table() calls with recent sqlalchemy versions
- 2.3.4
- Now requires biopython >=1.78
- Fixes biopython sequence usage in recent biopython
Expand Down
8 changes: 4 additions & 4 deletions chado/load/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

from future import standard_library

from sqlalchemy import Column, Float, ForeignKey, Integer, String, Table
from sqlalchemy import Column, Float, ForeignKey, Integer, String, Table, inspect
from sqlalchemy import exc as sa_exc

standard_library.install_aliases()
Expand Down Expand Up @@ -824,7 +824,7 @@ def _setup_tables(self, module):
self.ci.create_cvterm(term='analysis_blast_output_iteration_hits', term_definition='Hits of a blast', cv_name='tripal', db_name='tripal')
# Tables for blast
added_table = False
if not self.engine.dialect.has_table(self.engine, 'tripal_analysis_blast', schema='public'):
if not inspect(self.engine).has_table('tripal_analysis_blast', schema='public'):
tripal_analysis_blast_table = Table(
'tripal_analysis_blast', self.metadata,
Column('db_id', Integer, primary_key=True, nullable=False, default=0, index=True),
Expand All @@ -839,7 +839,7 @@ def _setup_tables(self, module):
tripal_analysis_blast_table.create(self.engine)
added_table = True

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

if not self.engine.dialect.has_table(self.engine, 'blast_hit_data', schema=self.ci.dbschema):
if not inspect(self.engine).has_table('blast_hit_data', schema=self.ci.dbschema):
blast_hit_data_table = Table(
'blast_hit_data', self.metadata,
Column('analysisfeature_id', Integer, ForeignKey(self.model.analysisfeature.analysisfeature_id, ondelete="CASCADE"), nullable=False, index=True, primary_key=True),
Expand Down
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

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

project = "Python-chado"

extensions = ['sphinx.ext.autodoc', 'sphinx.ext.napoleon']
master_doc = 'index'

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="chado",
version='2.3.4',
version='2.3.5',
description="Chado library",
author="Anthony Bretaudeau",
author_email="[email protected]",
Expand Down

0 comments on commit 99208a9

Please sign in to comment.