Skip to content

Commit

Permalink
Fix docs on creating CustomOperator (#8678)
Browse files Browse the repository at this point in the history
(cherry picked from commit 5e1c33a)
  • Loading branch information
JonnyWaffles authored and potiuk committed Jun 29, 2020
1 parent f6a87f5 commit 458604f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/howto/custom-operator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ the operator.
self.name = name
def execute(self, context):
message = "Hello from {}".format(name)
message = "Hello from {}".format(self.name)
print(message)
return message
Expand All @@ -157,9 +157,9 @@ You can use the template as follows:
.. code:: python
with dag:
hello_task = HelloOperator(task_id='task_id_1', dag=dag, name='{{ task_id }}')
hello_task = HelloOperator(task_id='task_id_1', dag=dag, name='{{ task_instance.task_id }}')
In this example, Jinja looks for the ``name`` parameter and substitutes ``{{ task_id }}`` with
In this example, Jinja looks for the ``name`` parameter and substitutes ``{{ task_instance.task_id }}`` with
``task_id_1``.


Expand Down

0 comments on commit 458604f

Please sign in to comment.