potiuk commented on code in PR #61036:
URL: https://github.com/apache/airflow/pull/61036#discussion_r2933868112


##########
airflow-core/src/airflow/cli/commands/dag_processor_command.py:
##########
@@ -35,7 +36,15 @@
 def _create_dag_processor_job_runner(args: Any) -> DagProcessorJobRunner:
     """Create DagFileProcessorProcess instance."""
     if args.bundle_name:
-        cli_utils.validate_dag_bundle_arg(args.bundle_name)
+        original_ctx = os.environ.get("_AIRFLOW_PROCESS_CONTEXT")

Review Comment:
   **Suggestion: Consider setting the context in the `action_cli` decorator 
instead.**
   
   This fix is scoped to just this one call site, but the underlying problem 
(CLI commands needing server context before validation logic runs) could affect 
other commands too. Setting `_AIRFLOW_PROCESS_CONTEXT = "server"` inside the 
`action_cli` decorator (when `check_db=True`) would provide a centralized 
solution and match what the PR description actually claims to do.
   
   If a localized fix is preferred, that's acceptable — but then the PR 
description should be updated to match the actual implementation.



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