Skip to content

Add BlueprintDagImporter to load Blueprint YAML natively in Airflow 3.4+ - #92

Open
BasPH wants to merge 5 commits into
astronomer:mainfrom
BasPH:aip-85-importer
Open

BasPH wants to merge 5 commits into
astronomer:mainfrom
BasPH:aip-85-importer

Conversation

@BasPH

@BasPH BasPH commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Airflow 3.4 introduced the Dag importer interface (AbstractDagImporter). This PR adds blueprint.importer.BlueprintDagImporter, so Blueprint YAML files load natively and the loader-file workaround (build_all_airflow_dags() in a loader.py) is no longer needed.

Enable it by configuring:

[dag_processor]
dag_importer_configs = ["blueprint.importer.BlueprintDagImporter"]

Example screenshots

YAML is displayed in code view (instead of a loader file):
image

Broken YAMLs reference the yaml file instead of the loader file (no need for that anymore):
image

Notes

  • The DagImporter doesn't support compound extensions such as *.dag.yaml. Therefore you wouldn't be able to run both this importer and a YamlDagImporter together.
  • Airflow 3.4+

🤖 Generated with Claude Code

BasPH and others added 4 commits November 6, 2026 16:38
The default pattern is `*.dag.yaml`, which never matches `.yml` names, so
claiming `.yml` by default only risked displacing another importer's
extension. Default `extensions` to `[".yaml"]` and let users widen both
`extensions` and `pattern` to load `.yml`.

Also document every method in reST, and rename `_root` to `_bundle_root`
to say what it returns. Simplify the README and module examples to the
bare classpath, since the default extension now needs no config.

The import of `airflow.sdk.importers` carries a `ty` ignore because the
dev environment pins an Airflow older than 3.4, which lacks the module.

Co-Authored-By: Claude <noreply@anthropic.com>
Cover the new default extension and the `extensions` override, point the
registry test at the bare classpath so it exercises the default, and give
every test a docstring saying what it validates.

Co-Authored-By: Claude <noreply@anthropic.com>
@BasPH
BasPH requested a review from a team as a code owner November 11, 2026 15:08

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant