casra-developers commented on a change in pull request #16110:
URL: https://github.com/apache/airflow/pull/16110#discussion_r641322409
##########
File path: airflow/operators/python.py
##########
@@ -377,9 +377,20 @@ def execute_callable(self):
render_template_as_native_obj=self.dag.render_template_as_native_obj,
)
+ # find python executable folder
+ candidates = [os.path.join(tmp_dir, 'bin'), os.path.join(tmp_dir,
'scripts')]
+ python_folder = None
+ for candidate in candidates:
+ if os.path.isdir(candidate):
+ python_folder = candidate
+ break
+
+ if python_folder is None:
+ raise AirflowException(f'Unable to find python executable in
"{tempdir}"')
+
execute_in_subprocess(
cmd=[
- f'{tmp_dir}/bin/python',
+ os.path.join(python_folder, 'python'),
Review comment:
Very nice, I didn't know about this function. Updated in the latest
commit.
--
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]