airflow.sensors.python

模組內容

類別

PythonSensor

等待 Python callable 回傳 True。

class airflow.sensors.python.PythonSensor(*, python_callable, op_args=None, op_kwargs=None, templates_dict=None, **kwargs)[原始碼]

繼承自:airflow.sensors.base.BaseSensorOperator

等待 Python callable 回傳 True。

使用者可以將輸入參數放在 templates_dict 中,例如 templates_dict = {'start_ds': 1970},並在 callable 中呼叫 kwargs['templates_dict']['start_ds'] 來存取參數

參數
  • python_callable (Callable) – callable 物件的參考

  • op_kwargs (Mapping[str, Any] | None) – 關鍵字引數的字典,將在您的函數中解包

  • op_args (list | None) – 位置引數的列表,將在呼叫您的 callable 時解包

  • templates_dict (dict | None) – 一個字典,其中的值是範本,這些範本將在 Airflow 引擎在 __init__execute 之間進行範本化,並在範本應用後在您的 callable 的上下文中提供。

另請參閱

如需更多關於如何使用此感測器的資訊,請參閱指南:PythonSensor

template_fields: Sequence[str] = ('templates_dict', 'op_args', 'op_kwargs')[原始碼]
poke(context)[原始碼]

衍生此類別時覆寫。

這個條目是否有幫助?