You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2025/02/12 14:44:11 UTC

[PR] Handle null logical date in TI.log_url [airflow]

uranusjr opened a new pull request, #46680:
URL: https://github.com/apache/airflow/pull/46680

   This was causing issues.
   
   ```
   [2025-02-12T14:26:56.727+0000] {scheduler_job_runner.py:930} ERROR - Exception when executing SchedulerJob._run_scheduler_loop
   Traceback (most recent call last):
     File "/opt/airflow/airflow/jobs/scheduler_job_runner.py", line 926, in _execute
       self._run_scheduler_loop()
     File "/opt/airflow/airflow/jobs/scheduler_job_runner.py", line 1056, in _run_scheduler_loop
       num_finished_events += self._process_executor_events(
     File "/opt/airflow/airflow/jobs/scheduler_job_runner.py", line 720, in _process_executor_events
       return SchedulerJobRunner.process_executor_events(
     File "/opt/airflow/airflow/jobs/scheduler_job_runner.py", line 811, in process_executor_events
       cls._set_span_attrs__process_executor_events(span, state, ti)
     File "/opt/airflow/airflow/jobs/scheduler_job_runner.py", line 888, in _set_span_attrs__process_executor_events
       "log_url": ti.log_url,
     File "/opt/airflow/airflow/models/taskinstance.py", line 2037, in log_url
       base_date = quote(self.logical_date.strftime("%Y-%m-%dT%H:%M:%S%z"))
   AttributeError: 'NoneType' object has no attribute 'strftime'
   ```
   
   ```
   [2025-02-12T14:31:59.755+0000] {validation.py:244} ERROR - http://localhost:28080/api/v1/dags/afexception/dagRuns/manual__2025-02-12T14:31:59.025683+00:00_YVpxZLzf/taskInstances/afexception_task validation error: None is not of type 'string'
   
   Failed validating 'type' in schema['properties']['logical_date']:
       {'type': 'string', 'format': 'datetime'}
   
   On instance['logical_date']:
       None
   [2025-02-12T14:31:59.756+0000] {_internal.py:224} INFO - 172.18.0.1 - - [12/Feb/2025 14:31:59] "GET /api/v1/dags/afexception/dagRuns/manual__2025-02-12T14:31:59.025683+00:00_YVpxZLzf/taskInstances/afexception_task HTTP/1.1" 500 -
   ```
   
   Since base_date is no longer used in the new UI, we can simply not render the param when logical date is None.


-- 
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


Re: [PR] Handle null logical date in TI.log_url [airflow]

Posted by "amoghrajesh (via GitHub)" <gi...@apache.org>.
amoghrajesh merged PR #46680:
URL: https://github.com/apache/airflow/pull/46680


-- 
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