airflow.providers.standard.sensors.python

PythonSensor

等待一個 Python 可呼叫物件返回 True。

模組內容

class airflow.providers.standard.sensors.python.PythonSensor(*, python_callable, op_args=None, op_kwargs=None, templates_dict=None, **kwargs)[source]

基類: 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 引擎進行模板化,並在模板應用後在您的可呼叫物件的上下文中可用。

另請參閱

有關如何使用此 Sensor 的更多資訊,請參閱指南:PythonSensor

template_fields: collections.abc.Sequence[str] = ('templates_dict', 'op_args', 'op_kwargs')[source]
python_callable[source]
op_args = [][source]
op_kwargs[source]
templates_dict = None[source]
poke(context)[source]

派生此類時重寫此方法。

此條目有幫助嗎?