Skip to content

Add prek hook enforcing the "example" tag on example DAGs#67354

Merged
jscheffl merged 1 commit into
apache:mainfrom
andreahlert:feat/52477-example-dag-tag-check
May 23, 2026
Merged

Add prek hook enforcing the "example" tag on example DAGs#67354
jscheffl merged 1 commit into
apache:mainfrom
andreahlert:feat/52477-example-dag-tag-check

Conversation

@andreahlert
Copy link
Copy Markdown
Contributor

Example DAGs are filtered and grouped by tag across the docs and the UI, but the example tag was applied inconsistently. This adds an AST-based prek hook, check-example-dag-tags, that fails when a DAG defined under an example_dags/ folder does not carry the example tag.

The hook resolves DAG(...), with DAG(...) as ...:, @dag(...) and bare @dag decorators, and requires tags to be an inline list/tuple literal containing "example" so it stays statically verifiable. A unit test covering each form lives at scripts/tests/ci/prek/test_check_example_dag_tags.py.

Every current violator (112 DAG definitions across 41 files) is retagged in the same commit so the hook passes on a clean checkout.

Part of #52477


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

Example DAGs are filtered and grouped by tag across the docs and the UI,
but the "example" tag was applied inconsistently. This adds an AST-based
prek hook, check-example-dag-tags, that fails when a DAG defined under an
example_dags/ folder does not carry the "example" tag, and retags every
current violator so the hook passes on a clean checkout.

Part of apache#52477

Signed-off-by: André Ahlert <andre@aex.partners>
Copy link
Copy Markdown
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

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

Cool!

@jscheffl jscheffl removed the backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch label May 23, 2026
@jscheffl jscheffl merged commit 477b148 into apache:main May 23, 2026
143 checks passed
Copy link
Copy Markdown
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

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

Nice

@andreahlert andreahlert deleted the feat/52477-example-dag-tag-check branch May 23, 2026 13:33
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.

3 participants