Add require_approval preflight check to @task.llm_schema_compare - #71688
Merged
gopidesupavan merged 1 commit intoSep 4, 2026
Merged
gopidesupavan merged 1 commit into
gopidesupavan merged 1 commit into
Conversation
@task.llm, @task.llm_branch, and @task.llm_sql all reject a non-string Sequence[UserContent] prompt combined with require_approval=True before the LLM runs, with an error naming the decorator the caller actually used. @task.llm_schema_compare was missing this decorator-level check, so the same misuse instead fell through to the underlying operator's own guard -- which names the internal _LLMSchemaCompareDecoratedOperator class rather than the decorator, confusing anyone who only ever wrote @task.llm_schema_compare.
gopidesupavan
approved these changes
Sep 4, 2026
Member
|
no harm having this check, but does anyone really uses images to compare schema 🤔 :) |
Contributor
Author
Yeah... I don't think anyone would actually do this either, but since users can somehow pull off such crazy edge cases, I figured we might as well keep the error feedback consistent across all four decorators 🤣... |
imrichardwu
pushed a commit
to imrichardwu/airflow
that referenced
this pull request
Sep 11, 2026
…che#71688) @task.llm, @task.llm_branch, and @task.llm_sql all reject a non-string Sequence[UserContent] prompt combined with require_approval=True before the LLM runs, with an error naming the decorator the caller actually used. @task.llm_schema_compare was missing this decorator-level check, so the same misuse instead fell through to the underlying operator's own guard -- which names the internal _LLMSchemaCompareDecoratedOperator class rather than the decorator, confusing anyone who only ever wrote @task.llm_schema_compare.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sumarry
@task.llm,@task.llm_branch, and@task.llm_sqlall reject a non-stringSequence[UserContent]prompt combined withrequire_approval=Truebefore the LLM ever runs, raising aTypeErrorthat names the decorator the caller actually used (e.g.@task.llm_branch: ...).@task.llm_schema_comparewas missing this decorator-level check. The same misuse still fails before any LLM call (the underlying operator has its own fallback guard), but the error instead names the internal_LLMSchemaCompareDecoratedOperatorclass -- an implementation detail the caller never wrote, which is confusing when debugging.This adds the same
reject_sequence_with_unsupported_featurepreflight call that the other three decorators already use, so all four give a consistent, decorator-named error message.Reproduce
Reproduced by running two tasks against the same misuse (
require_approval=Truewith aSequence[UserContent]prompt) -- one via@task.llm_branch, one via@task.llm_schema_compare-- and comparing the task logs.Before this change:
Note the first line names
_LLMSchemaCompareDecoratedOperator-- an internal class the caller never wrote -- while the second names@task.llm_branch, the decorator actually used.After this change:
The same misuse via
@task.llm_schema_compareinstead raises:now consistent with the other three decorators.