Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a simple draft with PoC of AIP-85 https://cwiki.apache.org/confluence/display/AIRFLOW/AIP-85+Extendable+DAG+parsing+controls.
The key highlights and proposed interfaces/implementations are:
airflow/dag_processing/dag_importer.py
: DagImporter - a mechanism abstracting a way of how a "path" is translated into one or more parsed DAGs.FSDagImporter
(airflow/dag_processing/fs_dag_importer.py
) - read a DAG from definition in a Python file.NotebooksImporter
(providers/src/airflow/providers/google/common/importers/notebooks_importer.py
), which imports Python definitions from Jupyter notebook files (for demonstration purposes only, not part of the actual AIP).airflow/dag_processing/dag_ingester.py
: DagIngester - a mechanism to abstract away the logic of operations of parsing/adding/updating/removing DAGs and their importing metadata (i.e. importing errors/warnings). Sample implementations:airflow/dag_processing/continuous_ingester.py
) - replication of the current regular dag-processor paring logic (by reusing current DagFileProcessingManagers)airflow/dag_processing/once_ingester.py
) - ingester that only imports DAGs onceThose 2 interfaces (that are allowed to be extended by providers/core Airflow) build a foundation to address AIP-85 requirements - increase flexibility of how DAGs are being updated and how they can be defined.
Apart from that, DagBag usage is replaced in most places with one of the following components:
airflow/dag_processing/dag_store.py
) - access to Airflow DAGs in metadata DBs (no access to DAG sources required). Used by any component that requires access to DAG's metadata (i.e. by scheduler, public API, etc.).airflow/dag_processing/dag_parser.py
) - access to parsed DAGs (used by worker and dag-processor).A lot of things are "swept under the rug" here as this is just a PoC based on an older Airflow branch before most of Airflow 3 changes landed. Big things that are missing:
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rst
or{issue_number}.significant.rst
, in newsfragments.