fix: resolve flaky tenant input validation in Python 3.12#2096
Open
Missing-Identity wants to merge 1 commit into
Open
fix: resolve flaky tenant input validation in Python 3.12#2096Missing-Identity wants to merge 1 commit into
Missing-Identity wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
|
To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge. |
Author
|
I have read the CLA Document and I sign the CLA |
Author
|
I agree to the CLA |
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.
Description
This PR resolves flaky runtime type-checking for tenant inputs specifically observed in Python 3.12+.
Problem
In Python 3.12, using
typing.Sequenceforisinstance()checks can exhibit flaky or unexpected behavior becausetyping.Sequenceis intended primarily for static analysis. This has led to intermittent validation failures when processing tenant lists in certain environments.Solution
Replaces
typing.Sequencewithcollections.abc.Sequencefor runtime validation inweaviate/validator.py. This ensures stable and consistent type-checking across all supported Python versions, including Python 3.12.Verification
Fixes #1355
Signed-off-by: Unmilan Mukherjee unmilanm@gmail.com