Skip to content

Commit

Permalink
Fix docs on creating CustomOperator (#8678)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyWaffles authored May 10, 2020
1 parent 7506c73 commit 5e1c33a
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 @@ -162,7 +162,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 @@ -171,9 +171,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 5e1c33a

Please sign in to comment.