Repository navigation
fix(typing): pass str dataset ids in tree table guest RLS rules - #46668
Merged
hainenber merged 1 commit intoNov 28, 2026
Merged
Conversation
The full-tree mypy run flags tree_table_guest_tests.py:704 and :841: GuestTokenRlsRule.dataset is typed Optional[str], but the tests passed self.table.id (int). Scoped mypy runs resolve SqlaTable.id as Any because superset_core is follow_imports=skip, so the per-PR check did not catch it. Runtime compares str(rule["dataset"]) to str(dataset.id), so behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #46668 +/- ##
=======================================
Coverage 86.23% 86.23%
=======================================
Files 3146 3146
Lines 220018 220018
Branches 52110 52110
=======================================
Hits 189725 189725
Misses 26823 26823
Partials 3470 3470
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
hainenber
approved these changes
Nov 28, 2026
hainenber
deleted the
ultraset-tree-table-guest-tests-dataset-typeddict-int
branch
November 28, 2026 08:06
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
The scheduled full-tree
mypy (main)pre-commit check on master fails with twotypeddict-itemerrors intests/integration_tests/charts/data/tree_table_guest_tests.py(lines 704 and 841). They came in with #46490 (e81334c), the only commit that touches this file.Root cause: both tests call
security_manager.create_guest_access_token(..., rls=[{"dataset": self.table.id, ...}]). Therlsargument islist[GuestTokenRlsRule], andGuestTokenRlsRule.datasetis typedOptional[str](superset/security/guest_token.py:266), butself.table.idis anint.SqlaTableinheritsid: intfromsuperset_core'sCoreDataset. Becausepyproject.tomlsetsfollow_imports = "skip"forsuperset_core.*, a scoped mypy run (such as the per-PR changed-files run) resolvesSqlaTable.idasAnyand passes. Only the full-tree run, which listssuperset-core/srcas an input, resolves it asintand reports the mismatch.Fix: pass
str(self.table.id)in both rules, as the other typed callers already do (for examplerow_level_security_tests.pyusesstr(dataset.id)). Runtime behaviour is unchanged:get_guest_rls_filterscomparesstr(rule.get("dataset")) == str(dataset.id), and the other consumers only check truthiness.TESTING INSTRUCTIONS
pre-commit run mypy --all-files.tests/integration_tests/charts/data/tree_table_guest_tests.py(on master it reports lines 704 and 841).pytest tests/integration_tests/charts/data/tree_table_guest_tests.pyagainst an integration test database and confirm the guest RLS tests still pass.ADDITIONAL INFORMATION
This is the same full-tree-only mypy mechanism (
follow_imports = "skip"forsuperset_core.*hidessuperset_coretypes from scoped runs) as #46634, which handles the other errors in the same scheduled run. Culprit: #46490 (e81334c, feat(ag-grid-table): add a Tree query mode).🤖 Generated with Claude Code