diff --git a/airflow-core/src/airflow/utils/log/file_task_handler.py b/airflow-core/src/airflow/utils/log/file_task_handler.py index 5314aa859c13f..cdb357b504bf2 100644 --- a/airflow-core/src/airflow/utils/log/file_task_handler.py +++ b/airflow-core/src/airflow/utils/log/file_task_handler.py @@ -605,9 +605,9 @@ def _read_from_logs_server(self, ti, worker_log_rel_path) -> tuple[LogSourceInfo sources.append(url) logs.append(response.text) except Exception as e: - from requests.exceptions import InvalidSchema + from requests.exceptions import InvalidURL - if isinstance(e, InvalidSchema) and ti.task.inherits_from_empty_operator is True: + if isinstance(e, InvalidURL) and ti.task.inherits_from_empty_operator is True: sources.append(self.inherits_from_empty_operator_log_message) else: sources.append(f"Could not read served logs: {e}")