potiuk commented on code in PR #74926:
URL: https://github.com/apache/airflow/pull/74926#discussion_r4367960953
##########
providers/google/src/airflow/providers/google/cloud/log/cloud_logging_task_handler.py:
##########
@@ -167,7 +167,15 @@ def transport(self) -> Transport:
def processors(self) -> tuple[structlog.typing.Processor, ...]:
import structlog.stdlib
- from airflow.sdk.log import relative_path_from_logger
+ from airflow.sdk.log import relative_path_from_logger as
_relative_path_from_logger
+
+ def relative_path_from_logger(logger) -> Path | None:
Review Comment:
Non-blocking follow-up: the real source of the problem is
`airflow.sdk.log.relative_path_from_logger`, which lets `Path.relative_to`
raise. Making it return `None` for paths outside `base_log_folder` would fix
this for every caller. This guard would still be needed for older Task SDK
versions, but new remote-log IOs wouldn't have to rediscover the problem.
---
Drafted-by: Claude Opus 5.5; reviewed by `potiuk` before posting
--
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]