PythonCallTaskMatcher

class ditto.matchers.PythonCallTaskMatcher(find_callable, nested_search=True)[source]

Bases: ditto.api.TaskMatcher

Matches a PythonOperator or BranchPythonOperator if their python_callable’s are making the matching method calls or are the same as the method calls to match against.

Parameters
  • find_callable (Callable) – the python method call to search for

  • nested_search (bool) – if True, will search the source code of the python_callable of the python airflow operators given, for the find_callable, otherwise will just match on the python_callable itself

does_match(task)[source]

Uses the python inspect module to get the source code for a given python method if nested_search is enabled, otherwise just matches on the python_callable of the PythonOperator or BranchPythonOperator

Parameters

task (BaseOperator) – the operator to match against

Return type

bool

Returns

whether or not it matched