ColtenOuO commented on code in PR #70137:
URL: https://github.com/apache/airflow/pull/70137#discussion_r3615615628
##########
providers/common/ai/src/airflow/providers/common/ai/operators/llm_sql.py:
##########
@@ -177,10 +177,12 @@ def _strip_llm_output(raw: str) -> str:
text = raw.strip()
if text.startswith("```"):
lines = text.split("\n")
- # Remove opening fence (```sql, ```, etc.) and closing fence
if len(lines) >= 2:
+ # Remove opening fence (```sql, ```, etc.) and closing fence
end = -1 if lines[-1].strip().startswith("```") else len(lines)
text = "\n".join(lines[1:end]).strip()
+ elif text.endswith("```") and len(text) > 6:
Review Comment:
Added!
Updated the comment to include single-line fence examples like ```SELECT
1```. Thanks for the review!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]