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 2021/11/08 18:31:39 UTC
[GitHub] [airflow] potiuk commented on issue #19477: 'NoneType' object has no attribute 'refresh_from_task' Error when manually running task instance
potiuk commented on issue #19477:
URL: https://github.com/apache/airflow/issues/19477#issuecomment-963448627
Copied from discussion:
here is some code examples:
```
from datetime import datetime
from airflow.operators.python_operator import PythonOperator
from airflow import DAG
with DAG('a_dag', schedule_interval=None, default_args={'start_date': datetime(2018, 1, 1, 0, 0, 0)}) as dag:
def success(*args, **kwargs):
print('ok')
some_task = PythonOperator(task_id='some_tasks', python_callable=success)
```
and with new task
```
from datetime import datetime
from airflow.operators.python_operator import PythonOperator
from airflow import DAG
with DAG('a_dag', schedule_interval=None, default_args={'start_date': datetime(2018, 1, 1, 0, 0, 0)}) as dag:
def success(*args, **kwargs):
print('ok')
some_task = PythonOperator(task_id='some_tasks', python_callable=success)
new_task = PythonOperator(task_id='new_task', python_callable=success)
and steps to reproduce:
```
1. Define "a_dag" with "some_tasks".
2. Create dag run (manually or by schedule)
3. Add "new_task" into dag, deploy code
4. Select "new_task" in UI and press "Run" button
--
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.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org