Skip to content

Commit a70fa78

Browse files
committed
Remove databricks fixes
1 parent 1e2d21f commit a70fa78

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

text_2_sql/text_2_sql_core/src/text_2_sql_core/connectors/ai_search.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,21 +198,19 @@ async def get_entity_schemas(
198198
logging.info("Search Text: %s", text)
199199

200200
retrieval_fields = [
201-
# "FQN",
201+
"FQN",
202202
"Entity",
203203
"EntityName",
204-
# "Schema",
205-
# "Definition",
206-
"Description",
204+
"Schema",
205+
"Definition",
207206
"Columns",
208207
"EntityRelationships",
209208
"CompleteEntityRelationshipsGraph",
210209
] + engine_specific_fields
211210

212211
schemas = await self.run_ai_search_query(
213212
text,
214-
# ["DefinitionEmbedding"],
215-
["DescriptionEmbedding"],
213+
["DefinitionEmbedding"],
216214
retrieval_fields,
217215
os.environ["AIService__AzureSearchOptions__Text2SqlSchemaStore__Index"],
218216
os.environ[
@@ -227,7 +225,7 @@ async def get_entity_schemas(
227225
for schema in schemas:
228226
filtered_schemas = []
229227

230-
# del schema["FQN"]
228+
del schema["FQN"]
231229

232230
if (
233231
schema["CompleteEntityRelationshipsGraph"] is not None

text_2_sql/text_2_sql_core/src/text_2_sql_core/connectors/databricks_sql.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,12 @@ async def get_entity_schemas(
9898
)
9999

100100
for schema in schemas:
101-
# schema["SelectFromEntity"] = ".".join(
102-
# [schema["Catalog"], schema["Schema"], schema["Entity"]]
103-
# )
104-
schema["SelectFromEntity"] = schema["Entity"]
101+
schema["SelectFromEntity"] = ".".join(
102+
[schema["Catalog"], schema["Schema"], schema["Entity"]]
103+
)
105104

106105
del schema["Entity"]
107-
# del schema["Schema"]
106+
del schema["Schema"]
108107
del schema["Catalog"]
109108

110109
if as_json:

text_2_sql/text_2_sql_core/src/text_2_sql_core/prompts/sql_disambiguation_agent.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ system_message:
4848
<unsuccessful_mapping_entry>
4949
- If you cannot map it to a column, add en entry to the disambiguation list with the clarification question you need from the user:
5050
- If there are multiple possible options, or you are unsure how it maps, make sure to ask a clarification question.
51+
- If there are no possible options, ask a clarification question for more detail.
5152
5253
{
5354
\"disambiguation\": [

0 commit comments

Comments
 (0)