Skip to content

Commit e53e79f

Browse files
authored
Merge pull request #114 from DanielaSchacherer/fix_sql_query_function
BUG: fixed sql_query function to work with multiple indices
2 parents 18f444b + 2421f25 commit e53e79f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

idc_index/index.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,4 +1777,11 @@ def sql_query(self, sql_query):
17771777
"""
17781778

17791779
index = self.index
1780+
# TODO: find a more elegant way to automate the following: https://www.perplexity.ai/search/write-python-code-that-iterate-XY9ppywbQFSRnOpgbwx_uQ
1781+
if hasattr(self, "sm_index"):
1782+
sm_index = self.sm_index
1783+
if hasattr(self, "sm_instance_index"):
1784+
sm_instance_index = self.sm_instance_index
1785+
if hasattr(self, "clinical_index"):
1786+
clinical_index = self.clinical_index
17801787
return duckdb.query(sql_query).to_df()

0 commit comments

Comments
 (0)