Guard code_mode example DAG on SQLToolset import#69677
Merged
gopidesupavan merged 1 commit intoJul 10, 2026
Merged
Conversation
gopidesupavan
approved these changes
Jul 10, 2026
joshuabvarghese
pushed a commit
to joshuabvarghese/airflow
that referenced
this pull request
Jul 16, 2026
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.
The
example_agent_operator_code_modeDAG inproviders/common/aifails to parse when the optional[sql]extra (sqlglot) is not installed. It referencesSQLToolsetat the module level without theif SQLToolset is not None:guard, so on a fresh environmentSQLToolsetisNoneand DAG parsing raisesTypeError: 'NoneType' object is not callable.This is a regression of the same class of bug fixed in #68497, which wrapped every SQL-dependent example DAG in this provider with the
if X is not None:guard. The code-mode example was added afterward in #68407 and reintroduced the problem by omitting the guard.This restores the established pattern: the DAG definition, its howto markers, and its registration call are all wrapped in
if SQLToolset is not None:, so the DAG loads only when the optional dependency is present and no longer errors on a fresh dev environment.Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.