Skip to content

Commit

Permalink
fixing not implemented error
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollman committed Oct 16, 2023
1 parent a0a6636 commit f6d8c7b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions dynamicannotationdb/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,17 @@ def get_unique_string_values(self, table_name: str):
unique_values = {}
with self.session_scope() as session:
for column_name in model.__table__.columns.keys():

# if the column is a string
if model.__table__.columns[column_name].type.python_type == str:
try:
python_type = model.__table__.columns[column_name].type.python_type
except NotImplementedError:
python_type = None
if python_type == str:
query = session.query(getattr(model, column_name)).distinct()
unique_values[column_name] = [row[0] for row in query.all()]
return unique_values

def get_views(self, datastack_name: str):
with self.session_scope() as session:
query = session.query(AnalysisView).filter(
Expand Down

0 comments on commit f6d8c7b

Please sign in to comment.