Prab-27 commented on code in PR #42007:
URL: https://github.com/apache/airflow/pull/42007#discussion_r1744450342
##########
tests/operators/test_python.py:
##########
@@ -374,6 +374,17 @@ def test_custom_logger_name_can_be_empty_string(self):
python_operator = PythonOperator(task_id="task",
python_callable=partial(int, 2), logger_name="")
assert python_operator.log.name == "airflow.task.operators"
+ def test_execute_tasks_new_python_interpreter(self, monkeypatch):
+ def not_callable():
+ raise RuntimeError("Should not be triggered")
+
+ python_operator = PythonOperator(
+ task_id="task", python_callable=not_callable,
execute_tasks_new_python_interpreter=False
+ )
+ monkeypatch.setattr(python_operator,
"execute_tasks_new_python_interpreter", True)
+ python_operator.modified_execute_tasks_new_python_interpreter()
+ assert
os.environ.get("AIRFLOW__CORE__EXECUTE_TASKS_NEW_PYTHON_INTERPRETER") == "True"
+
Review Comment:
Test for it , ENV VAR change to default and override new assigned value when
task instantiated
--
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]