PrincipalsOffice opened a new issue #19995:
URL: https://github.com/apache/airflow/issues/19995
### Apache Airflow version
2.2.2 (latest released)
### Operating System
Debian GNU/Linux
### Versions of Apache Airflow Providers
N/A
### Deployment
Other Docker-based deployment
### Deployment details
N/A
### What happened
When I created a TaskInstance object and tried to access its `log_url`
property, an `AttributeError: 'NoneType' object has no attribute 'isoformat'`
exception was raised.
### What you expected to happen
`task_instance.log_url` returns the correct url.
### How to reproduce
```
>>> import pendulum
>>> from airflow.models import DAG, TaskInstance
>>> from airflow.operators.dummy import DummyOperator
>>> dag = DAG("validation_dag", start_date=pendulum.parse("20200101"))
>>> task = DummyOperator(task_id="dummy_task", dag=dag,
task_group=dag.task_group)
>>> task_instance = TaskInstance(task, execution_date=execution_date,
run_id="test")
>>> task_instance.log_url
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/path_to_my_venv/python3.8/site-packages/airflow/models/taskinstance.py", line
651, in log_url
iso = quote(self.execution_date.isoformat())
AttributeError: 'NoneType' object has no attribute 'isoformat'
```
### Anything else
Not sure if the log_url in 2.2.2 even support the execution_date param
anymore. What's the official expected behavior?
### Are you willing to submit PR?
- [X] 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]