Skip to content

Go SDK: follow-up fix for rejecting invalid task handler registrations - #73643

Merged
jason810496 merged 2 commits into
apache:mainfrom
jason810496:fix/go-sdk/task-registration-follow-ups
Sep 25, 2026
Merged

jason810496 merged 2 commits into
apache:mainfrom
jason810496:fix/go-sdk/task-registration-follow-ups

Conversation

@jason810496

@jason810496 jason810496 commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Why

Three findings from the review of #73549:

  1. the variadic rejection was justified by a backwards description of reflect.Value.Call
  2. NewTaskFunction panicked inside reflect before it could report a non-func input
  3. --help ignored the writer Serve is given.

What

  • Check reflect.Func in NewTaskFunction before Value.Pointer, which panics on an int, and Value.Type, which panics on an untyped nil. bundle.NewTaskFunction(3) now returns expected a func as input but was int instead of panicking.

  • Correct the variadic rationale and tell the author what to write instead. binding.Analyze turns a ...T tail into one []T parameter, so supporting it would mean calling the function with CallSlice, and both spellings take a single argument, so []T stays the one spelling for that signature.

    // rejected: task function main.load is variadic;
    // declare the last parameter as []T instead of ...T
    func load(actx airflow.Context, names ...string) error
    
    func load(actx airflow.Context, names []string) error
  • Print --help usage to the writer serve receives instead of stderr. Only help moves: pflag writes a deprecation warning for a flag the bundle defines while it parses, so that stays on stderr where it cannot land in the middle of the --airflow-metadata manifest.


Was generative AI tooling used to co-author this PR?

@jason810496
jason810496 requested review from henry3260 and removed request for amoghrajesh and ashb September 24, 2026 03:44
@jason810496 jason810496 self-assigned this Sep 24, 2026

@henry3260 henry3260 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks LGTM

@jason810496
jason810496 merged commit a99f6fb into apache:main Sep 25, 2026
89 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants