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

   - related: https://github.com/apache/airflow/pull/71536
   - **Depends on https://github.com/apache/airflow/pull/70209 get merged 
first** (only the last commit is new here).
   - **Diff for early review**:
     
https://github.com/jason810496/airflow/compare/feature/go-sdk/taskflow-arg-binding...feature/go-sdk/temporal-uuid-arg-binding
   
   ## Why
   
   Stub annotations already carry temporal and UUID formats, but Go tasks 
receive the values as strings and must parse them again.
   
   ## What
   
   Bind each JSON Schema `format` to its native Go type:
   
   | Python annotation | wire `format` | Go parameter type |
   | --- | --- | --- |
   | `datetime`, `pendulum.DateTime` | `date-time` | `time.Time` |
   | `date` | `date` | `time.Time` (midnight) |
   | `time` | `time` | `time.Time` (zero date) |
   | `timedelta`, `pendulum.Duration` | `duration` | `time.Duration` |
   | `UUID` | `uuid` | `uuid.UUID` |
   
   ```go
   // The stub is annotated (when: datetime, window: timedelta, trace_id: UUID)
   // and called with the formatted strings those annotations imply.
   func ViaTemporalArgs(
       ctx sdk.TIRunContext, log *slog.Logger,
       when time.Time, window time.Duration, traceID uuid.UUID,
   ) (any, error)
   ```
   
   - Convert nested slices, maps, and struct fields recursively, with 
path-aware decode errors.
   - Reject incompatible Go types before the task runs. Nullable values require 
nil-capable types.
   - Keep plain `string` and custom `UnmarshalJSON` types as escape hatches.
   - Parse fixed ISO 8601 durations and reject variable-length year or month 
components.
   
   Values cross runtimes in JSON form. The example currently passes formatted 
strings; native Python `datetime`, `timedelta`, and `UUID` call arguments 
require the separate https://github.com/apache/airflow/pull/71536 Core change.
   
   ---
   
   ##### 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