Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cyyeh committed Aug 22, 2024
1 parent 5248794 commit ea9d190
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions wren-ai-service/src/pipelines/sql_explanation/generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,12 @@ def _collect_relations(relation, result, cte_names, top_level: bool = True):
{
"values": {
"type": relation["type"],
"criteria": relation["criteria"],
"criteria": relation["criteria"]["expression"],
"exprSources": [
{
"expression": expr_source["expression"],
"sourceDataset": expr_source["sourceDataset"],
"sourceColumn": expr_source["sourceColumn"],
}
for expr_source in relation["exprSources"]
],
Expand Down Expand Up @@ -360,12 +361,12 @@ def run(
},
}
for select_item, sql_explanation in zip(
preprocessed_sql_analysis_results["selectItems"][
"withFunctionCallOrMathematicalOperation"
],
sql_explanation_results["selectItems"][
"withFunctionCallOrMathematicalOperation"
],
preprocessed_sql_analysis_results.get(
"selectItems", {}
).get("withFunctionCallOrMathematicalOperation", []),
sql_explanation_results.get("selectItems", {}).get(
"withFunctionCallOrMathematicalOperation", []
),
)
] + [
{
Expand All @@ -378,12 +379,12 @@ def run(
},
}
for select_item, sql_explanation in zip(
preprocessed_sql_analysis_results["selectItems"][
"withoutFunctionCallOrMathematicalOperation"
],
sql_explanation_results["selectItems"][
"withoutFunctionCallOrMathematicalOperation"
],
preprocessed_sql_analysis_results.get(
"selectItems", {}
).get("withoutFunctionCallOrMathematicalOperation", []),
sql_explanation_results.get("selectItems", {}).get(
"withoutFunctionCallOrMathematicalOperation", []
),
)
]

Expand Down

0 comments on commit ea9d190

Please sign in to comment.