Repository navigation
Reject allowed_tables=None in SQLToolset so only omitting it allows every table - #73452
Merged
Merged
Conversation
vatsrahul1001
approved these changes
Sep 21, 2026
This was referenced Sep 21, 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.
Follow-up to #73381, which made
SQLToolset(allowed_tables=[])raise instead of exposing every table.allowed_tables=Nonestill had that effect, and it is the more common shape for a list that "resolves to nothing":Variable.get("tables", default_var=None), adict.get(), a JSONnullfrom a config file. The guardrail #73381 added therefore still switched itself off for exactly the Dags it was meant to protect.allowed_tablesnow defaults to a private sentinel instead ofNone. Omitting the argument keeps the old allow-all behaviour, but no value requests it any more:Noneand[]both raiseValueErrorat construction. A runtime lookup that comes back empty can only make the toolset fail at Dag import, never widen it to the whole schema. Exposing every table stays possible, but only as a static decision visible in the Dag file.Why a sentinel rather than making
allowed_tablesrequired or adding anallow_all_tablesflag. Allow-all is a legitimate default for a scratch or read-only database and every example Dag relies on it, so requiring the argument would break the common case for no safety gain. A separate opt-in flag adds surface for something the absence of the argument already expresses. The sentinel is the same_UNSET = object()pattern the provider's pydantic-ai hook already uses to tell "not passed" from an explicitNone.Because #73381 is unreleased, its changelog note is rewritten in place to cover both values rather than adding a second note. Dags that passed
allowed_tables=Noneexplicitly should drop the argument; nothing else changes. Common AI is still 0.x.{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.