anteverse commented on code in PR #38247:
URL: https://github.com/apache/airflow/pull/38247#discussion_r1528659079
##########
airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -480,7 +480,8 @@ def consume_logs(*, since_time: DateTime | None = None) ->
tuple[DateTime | None
self._callbacks.progress_callback(
line=line, client=self._client,
mode=ExecutionMode.SYNC
)
- self.log.info("[%s] %s", container_name, message_to_log)
+ if message_to_log and message_to_log.strip():
+ self.log.info("[%s] %s", container_name,
message_to_log)
Review Comment:
What if the container logs empty lines on purpose, unusual in logs but
something like a print("\n") for spacing?
We would expect to still get this line?
I assumed we would only need to test if `message_to_log is not None`, as
`message_to_log = None` explicitly tells us no line got fetched from the
container, whereas a `message_to_log == ""` could still mean a log line got
fetched from the container (as expected), even if the actual line is an empty
string.
This would work for my case but I wonder if this could create a side effect
for users working with applications that space their output with empty line.
--
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]