bramhanandlingala opened a new pull request, #70399:
URL: https://github.com/apache/airflow/pull/70399

   ## Summary
   
   `include_examples` was silently removed from `DagBag.__init__` and 
`DagBag.collect_dags()` in a minor version bump (3.1.8 -> 3.3.0), breaking any 
code that constructs `DagBag` directly with this argument — a common pattern in 
custom scripts and DAG validation tests — with a `TypeError: __init__() got an 
unexpected keyword argument 'include_examples'`. This wasn't mentioned in the 
3.3.0 release notes and violates semver expectations for a minor release.
   
   ## Root Cause
   
   Example DAGs are now loaded via the DAG bundle system (`DagBundlesManager`) 
instead of `DagBag` scanning `airflow.example_dags` directly. That 
architectural change is reasonable on its own, but the `include_examples` 
parameter was removed outright instead of being deprecated, so any caller 
passing it — whether `True` or `False` — hits a hard crash instead of a warning.
   
   ## Fix
   
   Restores `include_examples` to `DagBag.__init__` and 
`DagBag.collect_dags()`, along with `BundleDagBag`'s guard against 
`include_examples=True`. When the parameter is omitted (the common case), 
behavior is unchanged and no warning is emitted. When passed explicitly, it 
still works as it did pre-3.3.0 but now emits a `DeprecationWarning` pointing 
callers to the new DAG bundle system instead of crashing. Added 
`TestDagBagIncludeExamples` in `test_dagbag.py` covering the omitted, 
explicit-True, explicit-False, and `BundleDagBag` cases.
   
   Fixes #70283


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