Skip to content

Commit

Permalink
Merge pull request #114 from DanielaSchacherer/fix_sql_query_function
Browse files Browse the repository at this point in the history
BUG: fixed sql_query function to work with multiple indices
  • Loading branch information
fedorov authored Aug 15, 2024
2 parents 18f444b + 2421f25 commit e53e79f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions idc_index/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -1777,4 +1777,11 @@ def sql_query(self, sql_query):
"""

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

0 comments on commit e53e79f

Please sign in to comment.