potiuk commented on PR #61036:
URL: https://github.com/apache/airflow/pull/61036#issuecomment-3799404773

   I think we are going to get rid of `_AIRFLOW_PROCESS_CONTEXT` altogether - 
correct @amoghrajesh  @bugraoz93  ? - so rather than moving it around, I would 
wait for completing the isolation process, where if needed we pass the 
necessary context to "shared" library from the calling process via some 
parameter during the initialization.
   
   Some of the cli methods are shared between `airflow-ctl` and `airflow` 
regular CLI commands, and this will be the main distinction that will determine 
whether the DB calls are made or CLI calls - and then, it will not be necessary 
to have an enviironment variable to pass the context. This is - as I see it - a 
bit of a hack to make it possible to use the same code in two places - and the 
current shared library context is taking another - more long term - approach, 
similarly the initialization will be more of a deliberate process where just 
"importing" airflow is not going to to do much - there will be a deliberate 
initialization code that will depend on which component is running the 
initialization and passign the right "context" via this initialization to the 
shared code seems to be a better approach.
   
   Maybe we can merge it as a temporary measure, but I don't see it as even 
mid-term sustainable approach.


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