mpolatcan commented on issue #39642:
URL: https://github.com/apache/airflow/issues/39642#issuecomment-2134009601
Hi @hterik, we faced same issue too. Problem is that `task_instance.log_url`
generates log url to page that has this error. So, I resolved issue by
generating custom execution log url with below function and use in operator
callbacks for our Slack notifications 😅:
```python
from datetime import datetime
from urllib.parse import quote
def __generate_execution_log_url(context: dict):
dag_id = context["dag_run"].dag_id
task_instance = context["ti"]
task_id = task_instance.task_id
encoded_execution_date =
quote(task_instance.execution_date.strftime("%Y-%m-%dT%H:%M:%S.%f%z"))
return
f"https://airflow.example.com/log?dag_id={dag_id}&task_id={task_id}&execution_date={encoded_execution_date}"
```
--
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]