You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
'NoneType' object has no attribute 'refresh_from_task' Error when manually running task instance #19477
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:
@potiuk as i can see in #19478, attempt of running newly created task will cause redirect with error message.
In previous versions airflow was creating and running new task instance - imho it is more preferable behaviour, beacause it is what user expects airflow to do
I am afraid it is not possible now because of how DAG serializatiion works (and I think this is correct behaviour to be honest). But you can raise a feature request for that (with justification etc.)
Activity
potiuk commentedon Nov 8, 2021
Copied from discussion:
here is some code examples:
and with new task
potiuk commentedon Nov 8, 2021
cc: @a-pertsev
Do not crash with stacktrace when task instance is missing
Do not crash with stacktrace when task instance is missing (#19478)
a-pertsev commentedon Nov 11, 2021
@potiuk as i can see in #19478, attempt of running newly created task will cause redirect with error message.
In previous versions airflow was creating and running new task instance - imho it is more preferable behaviour, beacause it is what user expects airflow to do
potiuk commentedon Nov 11, 2021
I am afraid it is not possible now because of how DAG serializatiion works (and I think this is correct behaviour to be honest). But you can raise a feature request for that (with justification etc.)