Python: release hotfix#22108
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Cherry-picks upstream work (from #22101) to make Python stdlib data-flow summaries more performant while keeping (or intentionally adjusting) the modeled behavior, and updates affected library tests accordingly.
Changes:
- Updates Python stdlib flow summaries to use more generalized “any element/with content” access-path forms.
- Hooks flow-summary “expects content” behavior into the dataflow internals.
- Adjusts Python library tests to reflect newly-modeled flows (and newly-accepted imprecision) in
zip(...)and Django ORMin_bulk.
Show a summary per file
| File | Description |
|---|---|
| python/ql/test/library-tests/frameworks/django-orm/testapp/orm_tests.py | Updates Django ORM in_bulk expectations to assert the now-modeled flow through .values(). |
| python/ql/test/library-tests/dataflow/coverage/test_builtins.py | Updates zip(...) expectations (including recording a newly observed false positive). |
| python/ql/lib/semmle/python/frameworks/Stdlib.qll | Refactors stdlib summaries to use generalized content encodings (e.g., any tuple/dict element, with-content). |
| python/ql/lib/semmle/python/dataflow/new/internal/FlowSummaryImpl.qll | Adds encoding support for “with content” summaries. |
| python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPrivate.qll | Wires expectsContent to flow-summary-provided expectations. |
Review details
- Files reviewed: 4/5 changed files
- Comments generated: 1
- Review effort level: Low
Comment on lines
4452
to
4453
| // We reduce generality slightly by not tracking tuple contents on list arguments beyond the first, for performance. | ||
| // TODO: Once we have TupleElementAny, this generality can be increased. |
mbg
approved these changes
Jul 2, 2026
mbg
left a comment
Member
There was a problem hiding this comment.
Approving since this is already merged into main. We will need this in the codeql-cli-2.26.0 branch either way for follow-up testing.
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.
Cherry-picked the commits from #22101.