Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jczhong84 committed Jul 31, 2023
1 parent 3e5ea65 commit 964493f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions querybook/server/lib/ai_assistant/base_ai_assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def _get_error_msg(self, error) -> str:

return str(error.args[0])

def _filter_column(self, column: DataTableColumn) -> bool:
def _should_skip_column(self, column: DataTableColumn) -> bool:
"""Override this method to filter out columns that are not needed."""
return False

Expand Down Expand Up @@ -140,7 +140,7 @@ def _generate_table_schema_prompt(
prompt += f"Description: {table_description}\n"
prompt += "Columns:\n"
for column in table.columns:
if self._filter_column(column):
if self._should_skip_column(column):
continue

prompt += f"- Column Name: {column.name}\n"
Expand All @@ -151,6 +151,7 @@ def _generate_table_schema_prompt(
# use data element's description when column's description is empty
# TODO: only handling the REF data element for now. Need to handle ARRAY, MAP and etc in the future.
prompt += f" Description: {column.data_elements[0].description}\n"
prompt += f" Data Element: {column.data_elements[0].name}\n"

prompt += "\n"

Expand Down

0 comments on commit 964493f

Please sign in to comment.