guan404ming commented on code in PR #71051:
URL: https://github.com/apache/airflow/pull/71051#discussion_r3758693367


##########
providers/common/ai/src/airflow/providers/common/ai/operators/llm_schema_compare.py:
##########
@@ -313,8 +324,32 @@ def execute(self, context: Context) -> dict[str, Any]:
         self.log.info("Running LLM schema comparison...")
         result = agent.run_sync(self.prompt, usage_limits=self.usage_limits)
         log_run_summary(self.log, result)
+        output = result.output
 
-        output_result = result.output.model_dump()
+        output_result = output.model_dump()
         self.log.info("Schema comparison result: \n %s", 
json.dumps(output_result, indent=2))
 
+        if self.require_approval:
+            severity_counts = Counter(mismatch.severity for mismatch in 
output.mismatches)
+            summary = ", ".join(
+                f"{severity_counts[severity]} {severity}"
+                for severity in ("critical", "warning", "info")
+                if severity_counts[severity]
+            )
+            body = (
+                f"Compatible: {output.compatible}"
+                + (f" (mismatches: {summary})" if summary else "")
+                + f"\n\n```\nPrompt: 
{self.prompt}\n\n{output.model_dump_json(indent=2)}\n```"

Review Comment:
   Tried it. Ruff format joins the implicit concatenation back into one line 🫠.



-- 
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]

Reply via email to