Skip to content

Go SDK: add airflow.Dag and dag.Task, the native Dag constructors - #73767

Merged
jason810496 merged 3 commits into
apache:mainfrom
FrankYang0529:airflow-go-sdk-native-dag-constructors
Sep 28, 2026
Merged

jason810496 merged 3 commits into
apache:mainfrom
FrankYang0529:airflow-go-sdk-native-dag-constructors

Conversation

@FrankYang0529

Copy link
Copy Markdown
Member

Implement Go SDK: Add airflow.Dag and dag.Task, the native Dag constructors.

  • airflow.Dag(dagId, spec) returns a *DagRef, which is a Registerable. Register stores the Dag separately from the task handlers and marks it as registered, so a later call to dag.Task panics.
  • dag.Task(fn, opts...) runs the same signature check as TaskHandler and returns a *TaskRef. The task_id is the Go function name, spelled exactly as in the source, unless TaskSpec{TaskID: ...} sets one.
  • Verification: go test ./...

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.

@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/bundle.go Outdated
Comment thread go-sdk/airflow/dag.go Outdated
Comment thread go-sdk/airflow/spec.go
@FrankYang0529
FrankYang0529 force-pushed the airflow-go-sdk-native-dag-constructors branch from b4f1fbe to ca23a69 Compare September 28, 2026 00:29
@FrankYang0529
FrankYang0529 marked this pull request as ready for review September 28, 2026 07:44
@FrankYang0529
FrankYang0529 force-pushed the airflow-go-sdk-native-dag-constructors branch from ca23a69 to 9f4335c Compare September 28, 2026 08:43

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

One minor nit, then I think we're good to go, thanks.

Comment thread go-sdk/adr/0008-native-dag-interface.md Outdated
Signed-off-by: PoAn Yang <payang@apache.org>
Signed-off-by: PoAn Yang <payang@apache.org>
Signed-off-by: PoAn Yang <payang@apache.org>
@FrankYang0529
FrankYang0529 force-pushed the airflow-go-sdk-native-dag-constructors branch from 9f4335c to d677ded Compare September 28, 2026 13:53

@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 232255e into apache:main Sep 28, 2026
89 checks passed
@FrankYang0529
FrankYang0529 deleted the airflow-go-sdk-native-dag-constructors branch September 28, 2026 23:49
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