jscheffl commented on PR #35210:
URL: https://github.com/apache/airflow/pull/35210#issuecomment-1830653754

   > I believe this change breaks this assumption. This 
`priority_strategy_class = import_string(strategy_name)` will be executed in 
schecduler, and the strategy can be defined in DAG - so essentially DAG author 
can supply a code that will be executed in scheduler during scheduling. The 
`priority_weight_total` property is used during scheduling ...
   > 
   > So I think this needs to be done as follow-up
   
   Are you sure it can inject "any" code by DAGs?
   In the example it might be a bit mis-leading, this is loaded by the DAG 
parser but the referenced class is from 
`airflow.example_dags.example_priority_weight_strategy.DecreasingPriorityStrategy`
 which is the same file but in the python path of installed airflow.
   Any other user-provided DAG will fail in lookup in scheduler as the 
Scheduler after parsing just de-serializes the DAG but as the DAG file itself 
is not in the PYTHONPATH will not be able to dynamically load a reference. So 
like "with the plugin approach" the Python file needs to be deployed in a 
proper manner into the scheduler instance.
   
   I rather fear that if a user follows the example and deploys a similar copy 
into the `/dags` folder it will just not work. Did somebody test this? (I had 
no time (yet). If yes anyway documentation needs to be updated any maybe it is 
just a docs rework and we are "safe by accident" :-D


-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to