Skip to content

Commit fae4f71

Browse files
Fix bug in Databricks Data dicationary (#97)
1 parent 175c91e commit fae4f71

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

adi_function_app/mark_up_cleaner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Licensed under the MIT License.
33
import logging
44
import json
5-
import re
5+
import regex as re
66

77

88
def get_sections(text: str) -> list:

deploy_ai_search/src/deploy_ai_search/deploy.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,30 @@ def deploy_config(arguments: argparse.Namespace):
1515
1616
Args:
1717
arguments (argparse.Namespace): The arguments passed to the script"""
18+
19+
suffix = None if args.suffix == "None" else args.suffix
1820
if arguments.index_type == "rag":
1921
index_config = RagDocumentsAISearch(
20-
suffix=arguments.suffix,
22+
suffix=suffix,
2123
rebuild=arguments.rebuild,
2224
enable_page_by_chunking=arguments.enable_page_chunking,
2325
)
2426
elif arguments.index_type == "text_2_sql_schema_store":
2527
index_config = Text2SqlSchemaStoreAISearch(
26-
suffix=arguments.suffix,
28+
suffix=suffix,
2729
rebuild=arguments.rebuild,
2830
single_data_dictionary_file=arguments.single_data_dictionary_file,
2931
)
3032
elif arguments.index_type == "text_2_sql_query_cache":
3133
index_config = Text2SqlQueryCacheAISearch(
32-
suffix=arguments.suffix,
34+
suffix=suffix,
3335
rebuild=arguments.rebuild,
3436
single_query_cache_file=arguments.single_query_cache_file,
3537
enable_query_cache_indexer=arguments.enable_query_cache_indexer,
3638
)
3739
elif arguments.index_type == "text_2_sql_column_value_store":
3840
index_config = Text2SqlColumnValueStoreAISearch(
39-
suffix=arguments.suffix,
41+
suffix=suffix,
4042
rebuild=arguments.rebuild,
4143
)
4244
else:

text_2_sql/text_2_sql_core/src/text_2_sql_core/data_dictionary/databricks_data_dictionary_creator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def extract_distinct_values_sql_query(
112112
Returns:
113113
str: The SQL query to extract distinct values from a column.
114114
"""
115-
return f"""SELECT DISTINCT {column.name} FROM {self.catalog}.{entity.entity} WHERE {column.name} IS NOT NULL ORDER BY {column.name} DESC;"""
115+
return f"""SELECT DISTINCT {column.name} FROM {self.catalog}.{entity.entity_schema}.{entity.entity} WHERE {column.name} IS NOT NULL ORDER BY {column.name} DESC;"""
116116

117117

118118
if __name__ == "__main__":

text_2_sql/text_2_sql_core/src/text_2_sql_core/prompts/answer_agent.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ system_message:
1414
{'sql_result_snippet': <SQL QUERY RESULT 2>, 'sql_query_used': '<SOURCE 2 SQL QUERY>', 'explanation': '<EXPLANATION OF SQL QUERY 2>'},
1515
]
1616
}
17+
1718
"

0 commit comments

Comments
 (0)