github-actions[bot] opened a new pull request, #71956:
URL: https://github.com/apache/airflow/pull/71956

   AirflowRuntimeVaryingValueChecker.visit_With() called exit_dag_context()
   unconditionally at the end of every with-statement. When a non-DAG
   with-statement (e.g. `with open(...) as f`) was nested inside a DAG
   with-block, it would set is_in_dag_context=False, causing any tasks
   constructed AFTER the nested with — but still inside the DAG block —
   to be invisible to the checker. Those tasks were never flagged for
   runtime-varying values even when they used datetime.now(), random(), etc.
   
   Fix: guard the exit_dag_context() call with `if is_with_dag_context`
   so only the with-statement that actually entered the DAG context exits it.
   
   Regression tests added for:
   - nested non-DAG with followed by a task (primary case)
   - multiple successive nested non-DAG withs
   - task constructed inside a nested non-DAG with
   - task outside the DAG block not over-flagged after the fix
   (cherry picked from commit c1fcbefd71256cc47cafc2cb989a0ac58838035a)
   
   Co-authored-by: Pradeep Kalluri 
<[email protected]>


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