Owen-CH-Leung opened a new pull request, #53529:
URL: https://github.com/apache/airflow/pull/53529

   closes: #53527
   
   Airflow 3 introduces several mandatory variable for `api-server`. One of 
them is `show_external_log_redirect` in the `ConfigResponse` class
   
   
https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/config.py#L36
   
   This class will be validated by `pydantic` and if the validation fails, it 
returns runtime error as described in the issue
   
   ```
   pydantic_core._pydantic_core.ValidationError: 1 validation error for 
ConfigResponse
   show_external_log_redirect
     Input should be a valid boolean [type=bool_type, input_value=None, 
input_type=NoneType]
       For further information visit 
https://errors.pydantic.dev/2.11/v/bool_type
   ```
   
   Such validation will take place when `api-server` is up and running and a 
http request is sent to the endpoint `/config`. See
   
   
https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/config.py#L44-L49
   
   Inside this handler function, an instance of `TaskLogReader` is created, and 
`show_external_log_redirect` will take the attribute value of 
`supports_external_link` in the task log reader
   
   Class `TaskLogReader` does have thie property `supports_external_link`, 
which will delegate it to the log handler's `supports_external_link`
   
   
https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/utils/log/log_reader.py#L147-L153
   
   But `OpensearchTaskHandler` does not impl this property. Hence None is sent 
to pydantic for validation and hence the error. 
   
   
   
   


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

Reply via email to