jason810496 commented on code in PR #69817:
URL: https://github.com/apache/airflow/pull/69817#discussion_r3619328796


##########
providers/amazon/src/airflow/providers/amazon/aws/log/s3_task_handler.py:
##########
@@ -46,6 +47,31 @@ class S3RemoteLogIO(LoggingMixin):  # noqa: D101
 
     processors = ()
 
+    @classmethod
+    def from_config(cls) -> S3RemoteLogIO:
+        """Build the remote log IO from Airflow logging configuration."""
+        remote_task_handler_kwargs = conf.getjson("logging", 
"remote_task_handler_kwargs", fallback={})
+        if not isinstance(remote_task_handler_kwargs, dict):
+            raise ValueError(
+                "logging/remote_task_handler_kwargs must be a JSON object (a 
python dict), we got "
+                f"{type(remote_task_handler_kwargs)}"
+            )
+        # remote_task_handler_kwargs mixes FileTaskHandler kwargs with IO 
kwargs; only the
+        # latter belong to this class (same split as 
airflow_local_settings.py).
+        fth_params = 
frozenset(inspect.signature(FileTaskHandler.__init__).parameters) - {

Review Comment:
   Thanks for the review.
   
   From my perspective, it should be fine to keep it as-is. Since the remote 
logging IO constructor (`from_config` class method) will only be called once in 
the whole process lifecycle and we cache the remote logging IO instance at 
module level.
   
   
https://github.com/apache/airflow/blob/ec08de79ab6367a464f9af5f33d43025ec9c8365/airflow-core/src/airflow/logging_config.py#L91-L101



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