airflow.providers.standard.sensors.python
¶
模組內容¶
類別¶
等待 Python 可調用物件回傳 True。 |
- class airflow.providers.standard.sensors.python.PythonSensor(*, python_callable, op_args=None, op_kwargs=None, templates_dict=None, **kwargs)[原始碼]¶
繼承自:
airflow.sensors.base.BaseSensorOperator
等待 Python 可調用物件回傳 True。
使用者可以將輸入參數放在 templates_dict 中,例如
templates_dict = {'start_ds': 1970}
,並透過在可調用物件中呼叫kwargs['templates_dict']['start_ds']
來存取該參數- 參數
python_callable (Callable) – 可調用物件的參考
op_kwargs (collections.abc.Mapping[str, Any] | None) – 將在您的函數中解包的關鍵字參數字典
op_args (list | None) – 將在呼叫您的可調用物件時解包的位置參數列表
templates_dict (dict | None) – 一個字典,其中的值是模板,這些模板將在
__init__
和execute
之間由 Airflow 引擎進行模板化,並在應用模板後在您的可調用物件的上下文中可用。
參見
有關如何使用此感測器的更多資訊,請查看指南: PythonSensor
- template_fields: collections.abc.Sequence[str] = ('templates_dict', 'op_args', 'op_kwargs')[原始碼]¶