Restore include_examples parameter to DagBag for backwards compatibility#70399
Closed
bramhanandlingala wants to merge 1 commit into
Closed
Restore include_examples parameter to DagBag for backwards compatibility#70399bramhanandlingala wants to merge 1 commit into
bramhanandlingala wants to merge 1 commit into
Conversation
bramhanandlingala
requested review from
ephraimbuddy and
jedcunningham
as code owners
July 24, 2026 16:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
include_exampleswas silently removed fromDagBag.__init__andDagBag.collect_dags()in a minor version bump (3.1.8 -> 3.3.0), breaking any code that constructsDagBagdirectly with this argument — a common pattern in custom scripts and DAG validation tests — with aTypeError: __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 ofDagBagscanningairflow.example_dagsdirectly. That architectural change is reasonable on its own, but theinclude_examplesparameter was removed outright instead of being deprecated, so any caller passing it — whetherTrueorFalse— hits a hard crash instead of a warning.Fix
Restores
include_examplestoDagBag.__init__andDagBag.collect_dags(), along withBundleDagBag's guard againstinclude_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 aDeprecationWarningpointing callers to the new DAG bundle system instead of crashing. AddedTestDagBagIncludeExamplesintest_dagbag.pycovering the omitted, explicit-True, explicit-False, andBundleDagBagcases.Fixes #70283