potiuk commented on a change in pull request #5304: [AIRFLOW-4541] Deprecate 
mkdirs utility function for pathlib
URL: https://github.com/apache/airflow/pull/5304#discussion_r285768517
 
 

 ##########
 File path: airflow/utils/log/file_task_handler.py
 ##########
 @@ -194,10 +195,7 @@ def _init_file(self, ti):
         # operator is not compatible with impersonation (e.g. if a Celery 
executor is used
         # for a SubDag operator and the SubDag operator has a different owner 
than the
         # parent DAG)
-        if not os.path.exists(directory):
-            # Create the directory as globally writable using custom mkdirs
-            # as os.makedirs doesn't set mode properly.
-            mkdirs(directory, 0o777)
+        pathlib.Path(directory).mkdir(mode=0o777, parents=True, exist_ok=True)
 
 Review comment:
   The comment above has quite detailed explanation and it seems in order to 
stop the madness we would have to fix impersonation for SubDag oprerator with 
different owner in case of re-runs... It's pretty edge case, but I guess it's 
quite valid (though not secure of course).

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


With regards,
Apache Git Services

Reply via email to