d-hervas commented on code in PR #73004:
URL: https://github.com/apache/airflow/pull/73004#discussion_r4105617597
##########
providers/amazon/src/airflow/providers/amazon/aws/log/cloudwatch_task_handler.py:
##########
@@ -148,11 +156,13 @@ def hook(self):
aws_conn_id=conf.get("logging", "remote_log_conn_id"),
region_name=self.region_name
)
- def _build_handler(self) -> watchtower.CloudWatchLogHandler:
+ def _build_handler(self, stream_name: str | None = None) ->
watchtower.CloudWatchLogHandler:
+ if stream_name is None:
+ stream_name = self.log_stream_name
_json_serialize = conf.getimport("aws",
"cloudwatch_task_handler_json_serializer", fallback=None)
return watchtower.CloudWatchLogHandler(
log_group_name=self.log_group,
- log_stream_name=self.log_stream_name,
+ log_stream_name=stream_name,
Review Comment:
Good catch. I directly applied the suggested change as it really is a
one-liner. Not sure if it's worth adding a test to catch this specific case.
--
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]