abhishekmauryaKsolves commented on code in PR #74667:
URL: https://github.com/apache/airflow/pull/74667#discussion_r4279010151
##########
go-sdk/cmd/airflow-go-pack/pack.go:
##########
@@ -165,6 +166,13 @@ func runPack(stdout, stderr io.Writer, opts *packOptions)
error {
return err
}
if len(meta.Dags) == 0 && len(meta.DagSourceFiles) == 0 {
+ if opts.strict {
+ return fmt.Errorf(
+ "no Dags or task handlers were registered at
pack time; " +
+ "--strict requires at least one. Drop
--strict if the bundle " +
+ "generates its Dags at run time",
+ )
Review Comment:
The check covers both. `meta.Dags` is built from the registered task handlers
(`ListTaskHandlers` in `collectManifest`), and `meta.DagSourceFiles` holds
the
native Dags authored with `airflow.Dag`. The condition fires only when both
are
empty (the `task_handler_dags` and `native_dags` counts in the pack output).
I added a comment on the check and a test that strict mode still packs a
bundle with only a task handler Dag.
--
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]