Refer to get_template_context for more context. This is the main method to derive when creating an operator.Ĭontext is the same dictionary used as when rendering jinja templates. Template_fields = ¶ template_fields_renderers ¶ BLUE = #ffefeb ¶ ui_color ¶ shallow_copy_attrs = ¶ execute ( self, context : Dict ) ¶ Processing templated fields, for examples Templates_exts ( list ) – a list of file extensions to resolve while In your callable’s context after the template has been applied. _init_ and execute takes place and are made available Will get templated by the Airflow engine sometime between Templates_dict ( dict ) – a dictionary where the values are templates that Op_args ( list ( templated )) – a list of positional arguments that will get unpacked when Op_kwargs ( dict ( templated )) – a dictionary of keyword arguments that will get unpacked
PythonOperator ( *, python_callable : Callable, op_args : Optional ] = None, op_kwargs : Optional ] = None, templates_dict : Optional = None, templates_exts : Optional ] = None, ** kwargs ) ¶ĭef my_python_callable ( ** kwargs ): ti = kwargs next_ds = kwargs Parameters Dict will unroll to xcom values with keys as keys.Ĭlass. Multiple_outputs ( bool) – if set, function return value will be Op_args ( list) – a list of positional arguments that will get unpacked when Op_kwargs ( dict) – a dictionary of keyword arguments that will get unpacked
Python_callable ( python callable) – A reference to an object that is callable Please use the following instead:įrom corators import my_task() Parameters task ( python_callable : Optional = None, multiple_outputs : Optional = None, ** kwargs ) ¶Īn Airflow task. Obtain the execution context for the currently executing operator withoutĪ. Task(python_callable: Optional = None, multiple_outputs: Optional = None, **kwargs)ĭeprecated function that calls and allows users to turn a python function into