You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/04/30 20:36:04 UTC

[GitHub] [airflow] JonnyWaffles opened a new issue #8654: Custom Operator Documentation Typo

JonnyWaffles opened a new issue #8654:
URL: https://github.com/apache/airflow/issues/8654


   Hi friends,
   
   There is a typo in the documentation regarding customer operators [here](https://airflow.apache.org/docs/stable/howto/custom-operator.html#creating-a-custom-operator). `name` should be `self.name` and the task id template should probably be changed to `{{ task_instance.task_id  }}`
   
   
   ```python
   class HelloOperator(BaseOperator):
   
       template_fields = ['name']
   
       @apply_defaults
       def __init__(
               self,
               name: str,
               *args, **kwargs) -> None:
           super().__init__(*args, **kwargs)
           self.name = name
   
       def execute(self, context):
           message = "Hello from {}".format(self.name)
           print(message)
           return message
   ```
   and then {{ task_id }} should become
   
   ```hello_task = HelloOperator(task_id='task_id_1', dag=dag, name='{{ task_instance.task_id  }}')```
   
   Cheers
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] JonnyWaffles commented on issue #8654: Custom Operator Documentation Typo

Posted by GitBox <gi...@apache.org>.
JonnyWaffles commented on issue #8654:
URL: https://github.com/apache/airflow/issues/8654#issuecomment-622964633


   Hi friends the pull request is here https://github.com/apache/airflow/pull/8678


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] boring-cyborg[bot] commented on issue #8654: Custom Operator Documentation Typo

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #8654:
URL: https://github.com/apache/airflow/issues/8654#issuecomment-622096033


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [airflow] potiuk commented on issue #8654: Custom Operator Documentation Typo

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #8654:
URL: https://github.com/apache/airflow/issues/8654#issuecomment-622957570


   Changed the label. Maybe you would like to make A PR fixing it @JonnyWaffles? Airflow is a community project and anyone can contributed. Seems you know exactly how to fix the docs. An you can make Fork/PR/change the docs purely using Github interface.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org