Skip to content

Go SDK: declare data edges with airflow.Inputs - #73895

Merged
jason810496 merged 2 commits into
apache:mainfrom
FrankYang0529:airflow-go-sdk-inputs-data-edges
Oct 1, 2026
Merged

jason810496 merged 2 commits into
apache:mainfrom
FrankYang0529:airflow-go-sdk-inputs-data-edges

Conversation

@FrankYang0529

Copy link
Copy Markdown
Member

Implement Go SDK: Declare data edges with airflow.Inputs.

  • airflow.Inputs(refs...) is a TaskOption. dag.Task records the tasks in the order of the parameters after airflow.Context, and each of them becomes an upstream task of the new task.
  • dag.Task checks the inputs when it adds a task. It panics in these cases, with a message that names the new task and any upstream task involved:
    • The number of tasks in Inputs does not match the number of parameters after airflow.Context. A task that has parameters but no Inputs counts as a mismatch.
    • An upstream task's result type cannot be assigned to the parameter it fills, by the same rule as a Go function call. For example, a *T result does not fit a T parameter.
    • An upstream task returns only an error, so it has no result to pass.
    • An upstream task belongs to another Dag.
    • The same task gets a second Inputs.

Was generative AI tooling used to co-author this PR?
  • Yes - Claude Code

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@FrankYang0529
FrankYang0529 marked this pull request as ready for review September 29, 2026 13:34

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR, LGTM overall.

Comment thread go-sdk/airflow/dag.go Resolved
Comment thread go-sdk/airflow/inputs.go Resolved
Comment thread go-sdk/airflow/task_option.go Resolved
@FrankYang0529
FrankYang0529 force-pushed the airflow-go-sdk-inputs-data-edges branch from a0c967f to 85feefe Compare September 30, 2026 10:52
@FrankYang0529
FrankYang0529 force-pushed the airflow-go-sdk-inputs-data-edges branch from 85feefe to 1fec999 Compare October 1, 2026 02:02

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks.

@jason810496
jason810496 merged commit 3f19c14 into apache:main Oct 1, 2026
90 checks passed
@FrankYang0529
FrankYang0529 deleted the airflow-go-sdk-inputs-data-edges branch October 1, 2026 09:22
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