ephraimbuddy commented on code in PR #74793:
URL: https://github.com/apache/airflow/pull/74793#discussion_r4423433038


##########
airflow-core/src/airflow/dag_processing/manager.py:
##########
@@ -370,15 +463,18 @@ def run(self):
         By processing them in separate processes, we can get parallelism and 
isolation
         from potentially harmful user code.
         """
-        self.before_run()
         try:
+            self.before_run()
             return self._run_parsing_loop()
         finally:
             self.after_run()
 
     def before_run(self) -> None:
         """Set up state required before the parsing loop starts. Default 
implementation; override to customize."""
-        self.prepare_server_process_context()
+        if self.api_client is None:
+            self.prepare_server_process_context()
+        else:
+            self.prepare_api_secrets_context(self.api_client)

Review Comment:
   Kept the flag and updated the docstrings. Requested work, the one clean 
seam, is now an injected RequestedWorkSource. Elsewhere the API and DB paths 
share most of the logic and differ in a few statements, so a subclass would 
either duplicate it or need those methods split into hooks first. 
test_manager_api_isolation.py checks that API mode makes no DB calls. If you 
still prefer a subclass, I'd do it as a follow-up after the stack lands.



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