jason810496 opened a new pull request, #73643:
URL: https://github.com/apache/airflow/pull/73643

   - related: #73549 (follow-up on post-merge review comments)
   
   ## 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` and 
`Value.Type`, both of which panic on a non-func. `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. 
A `...T` tail is one `[]T` parameter that a single task argument has to fill, 
which is what `[]T` already says, so `[]T` stays the one spelling for that 
signature.
   
     ```go
     // 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
     ```
   
   - Point the flag set at the writer `serve` receives, so `--help` usage goes 
there instead of stderr. Flag errors are unaffected, `serve` still returns them 
and prints nothing.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] Yes, with help of Claude Code Opus 5 following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


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