Lee-W commented on code in PR #74450:
URL: https://github.com/apache/airflow/pull/74450#discussion_r4227207738


##########
providers/common/ai/src/airflow/providers/common/ai/operators/llm_branch.py:
##########
@@ -160,7 +160,11 @@ def __init__(
         ignore_downstream_trigger_rules: bool = False,
         **kwargs: Any,
     ) -> None:
-        kwargs.pop("output_type", None)
+        if "output_type" in kwargs:

Review Comment:
   `LLMSQLQueryOperator` and `LLMSchemaCompareOperator` (and `@task.llm_sql` / 
`@task.llm_schema_compare`) now raise `TypeError` when `output_type` is passed, 
instead of dropping or overwriting it.
   
   I kept the check in each subclass rather than a class-level flag: 
`output_type` is a named parameter of `LLMOperator.__init__` with a default of 
`str`, so the base class can't tell "not passed" from "passed `str`" without 
changing that default. Each subclass checks `kwargs` before 
`super().__init__()`, same as `LLMBranchOperator`. Mapped tasks (`.partial()` / 
`.expand()`) raise when unmapped on the worker, also like `LLMBranchOperator`.
   
   Not changed here: `LLMSchemaCompareOperator` also silently overrides 
`serialize_output`.



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