dheerajturaga commented on code in PR #60675:
URL: https://github.com/apache/airflow/pull/60675#discussion_r2724383833


##########
providers/celery/src/airflow/providers/celery/cli/celery_command.py:
##########
@@ -189,8 +189,27 @@ def filter(self, record):
 @_providers_configuration_loaded
 def worker(args):
     """Start Airflow Celery worker."""
-    # This needs to be imported locally to not trigger Providers Manager 
initialization
-    from airflow.providers.celery.executors.celery_executor import app as 
celery_app
+    team_config = None
+    if hasattr(args, "team") and args.team:
+        # Multi-team is enabled, create team-specific Celery app and use team 
based config
+        try:
+            from airflow.executors.base_executor import ExecutorConf
+        except ImportError:
+            raise SystemExit(
+                f"Error: Multi-team support (--team {args.team}) requires 
Airflow >=3.2. "
+                "Please upgrade Airflow or remove the --team parameter."
+            )

Review Comment:
   Add attribute check before creating the ExecutorConf object?
   
   ```suggestion
               )
   
           # Check if ExecutorConf has required methods for multi-team support
           if not hasattr(ExecutorConf, 'getsection'):
               raise SystemExit(
                   f"Error: Multi-team support (--team {args.team}) requires 
Airflow >=3.2. "
                   "Please upgrade Airflow or remove the --team parameter."
               )
               
   ```



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