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/10/21 20:44:27 UTC
[GitHub] [airflow] andreychernih opened a new issue #19143: TypeError: unsupported operand type(s) for +=: 'NoneType' and 'datetime.timedelta'
andreychernih opened a new issue #19143:
URL: https://github.com/apache/airflow/issues/19143
### Apache Airflow version
2.2.0 (latest released)
### Operating System
Debian
### Versions of Apache Airflow Providers
_No response_
### Deployment
Other Docker-based deployment
### Deployment details
_No response_
### What happened
I've upgraded to Airflow 2.2.0 and added a new operator to the existing DAG:
```
delay_sensor = TimeDeltaSensorAsync(task_id="wait", delta=timedelta(hours=24))
```
I've started getting an error:
```
[2021-10-21, 20:01:17 UTC] {taskinstance.py:1686} ERROR - Task failed with exception
Traceback (most recent call last):
File "/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py", line 1324, in _run_raw_task
self._execute_task_with_callbacks(context)
File "/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py", line 1443, in _execute_task_with_callbacks
result = self._execute_task(context, self.task)
File "/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py", line 1499, in _execute_task
result = execute_callable(context=context)
File "/home/airflow/.local/lib/python3.8/site-packages/airflow/sensors/time_delta.py", line 54, in execute
target_dttm += self.delta
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'datetime.timedelta'
[2021-10-21, 20:01:17 UTC] {taskinstance.py:1270} INFO - Marking task as UP_FOR_RETRY. dag_id=integration-ups-mpos-2215, task_id=wait, execution_date=20211020T070000, start_date=20211021T200117, end_date=20211021T200117
[2021-10-21, 20:01:17 UTC] {standard_task_runner.py:88} ERROR - Failed to execute job 1458 for task wait
Traceback (most recent call last):
File "/home/airflow/.local/lib/python3.8/site-packages/airflow/task/task_runner/standard_task_runner.py", line 85, in _start_by_fork
args.func(args, dag=self.dag)
File "/home/airflow/.local/lib/python3.8/site-packages/airflow/cli/cli_parser.py", line 48, in command
return func(*args, **kwargs)
File "/home/airflow/.local/lib/python3.8/site-packages/airflow/utils/cli.py", line 92, in wrapper
return f(*args, **kwargs)
File "/home/airflow/.local/lib/python3.8/site-packages/airflow/cli/commands/task_command.py", line 292, in task_run
_run_task_by_selected_method(args, dag, ti)
File "/home/airflow/.local/lib/python3.8/site-packages/airflow/cli/commands/task_command.py", line 107, in _run_task_by_selected_method
_run_raw_task(args, ti)
File "/home/airflow/.local/lib/python3.8/site-packages/airflow/cli/commands/task_command.py", line 180, in _run_raw_task
ti._run_raw_task(
File "/home/airflow/.local/lib/python3.8/site-packages/airflow/utils/session.py", line 70, in wrapper
return func(*args, session=session, **kwargs)
File "/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py", line 1324, in _run_raw_task
self._execute_task_with_callbacks(context)
File "/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py", line 1443, in _execute_task_with_callbacks
result = self._execute_task(context, self.task)
File "/home/airflow/.local/lib/python3.8/site-packages/airflow/models/taskinstance.py", line 1499, in _execute_task
result = execute_callable(context=context)
File "/home/airflow/.local/lib/python3.8/site-packages/airflow/sensors/time_delta.py", line 54, in execute
target_dttm += self.delta
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'datetime.timedelta'
```
It looks like 2 new fields that were introduced in "dag_run" table:
* data_interval_start
* data_interval_end
I see that these fields are populated correctly for new DAG-s but for the old DAG-s the data is not back-filled.

### What you expected to happen
_No response_
### How to reproduce
_No response_
### Anything else
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
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
[GitHub] [airflow] boring-cyborg[bot] commented on issue #19143: TypeError: unsupported operand type(s) for +=: 'NoneType' and 'datetime.timedelta'
Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #19143:
URL: https://github.com/apache/airflow/issues/19143#issuecomment-948989008
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.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] uranusjr closed issue #19143: TypeError: unsupported operand type(s) for +=: 'NoneType' and 'datetime.timedelta'
Posted by GitBox <gi...@apache.org>.
uranusjr closed issue #19143:
URL: https://github.com/apache/airflow/issues/19143
--
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