JPonte commented on a change in pull request #16264:
URL: https://github.com/apache/airflow/pull/16264#discussion_r654192109
##########
File path: airflow/providers/microsoft/azure/log/wasb_task_handler.py
##########
@@ -100,8 +100,8 @@ def close(self) -> None:
with open(local_loc) as logfile:
log = logfile.read()
self.wasb_write(log, remote_loc, append=True)
-
- if self.delete_local_copy:
+ keep_local = conf.getboolean('logging', 'KEEP_LOCAL_LOGS')
+ if self.delete_local_copy or not keep_local:
Review comment:
My only issue was keeping compatibility for those who right now rely on
that flag, not sure what's the policy regarding that.
##########
File path: airflow/providers/google/cloud/log/gcs_task_handler.py
##########
@@ -132,7 +134,10 @@ def close(self):
# read log and remove old logs to get just the latest additions
with open(local_loc) as logfile:
log = logfile.read()
- self.gcs_write(log, remote_loc)
+ success = self.gcs_write(log, remote_loc)
+ keep_local = conf.getboolean('logging', 'KEEP_LOCAL_LOGS')
+ if success and not keep_local:
+ shutil.rmtree(os.path.dirname(local_loc))
Review comment:
I avoided putting it on `FileTaskHandler` because it was a bit messy but
having a `RemoteFileTaskHandler` could indeed help there.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]