Skip to content

Go SDK: a pointer spec field cannot be set from a literal #73951

Description

@henry3260

What happens

airflow.DagSpec and airflow.TaskSpec carry 9 pointer fields, so that a value an author
sets explicitly is distinguishable from one left unset — a bool whose default comes from
Airflow config, such as catchup, is the clearest case.

Go does not allow taking the address of a literal, so the obvious spelling does not compile:

dag := airflow.Dag("etl", airflow.DagSpec{Catchup: &false})  // invalid operand

An author has to name a variable for every such field:

catchup := false
dag := airflow.Dag("etl", airflow.DagSpec{Catchup: &catchup})

What would fix it

Go 1.26's new(expr):

dag := airflow.Dag("etl", airflow.DagSpec{Catchup: new(false)})

Why this is deferred rather than done

go-sdk/go.mod is on go 1.25.0. Go 1.26 was released in February 2026, which is too new
to require of everyone who builds a Go bundle, so the floor is not being raised for this.
Decided while reviewing #73936.

An airflow.Ptr[T] generic helper was considered and rejected there: the pointer
transformation is the language's job, not the SDK's.

Acceptance

  • Go 1.26 is an acceptable minimum for the Go SDK.
  • go-sdk/go.mod raised to it.
  • new(expr) used in the Dag authoring docs and examples, so the spelling an author
    copies is the short one.

Drafted-by: Claude Code (Opus 5) (no human review before posting)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:go-sdkkind:taskA task that needs to be completed as part of a larger issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions