CheckClusterSubDagTransformer¶
-
class
ditto.transformers.subdag.CheckClusterSubDagTransformer(dag, defaults)[source]¶ Bases:
ditto.api.SubDagTransformerTransforms a create-if-not-exists subdag pattern commonly used in EMR airflow DAGs to the corresponding pattern for an Azure HDI airflow DAG
- Parameters
defaults¶ (
TransformerDefaults) – the default configuration for this subdag transformer
-
check_for_existing_emr_cluster¶ the python callable which checks if the cluster exists.
-
get_sub_dag_matcher()[source]¶ Implement this method to construct and return a DAG of matchers for ditto to then try to use and find a subdag in the source airflow DAG
- Return type
List[TaskMatcher]- Returns
list of root nodes of the
TaskMatcherDAG
-
transform(subdag, parent_fragment)[source]¶ Implement this method to do the actual transformation of the subdag found using the matchers returned by
get_sub_dag_matcher()- Parameters
subdag¶ (
DiGraph) –DAGFragmentrepresenting subdag of source DAG operators matchedparent_fragment¶ (
DAGFragment) – This will give you a linked-list of parentDAGFragment’s, uptil the root. Seeparent_fragment.
- Return type
- Returns
the
DAGFragmentof transformed airflowoperators