-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: model fields set and model config access #918
Conversation
📝 WalkthroughWalkthroughThe pull request introduces a new function, ✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
qdrant_client/_pydantic_compat.py (1)
56-57
: Consistent spacingThe added blank lines maintain the module's consistent style of separating function definitions, which is good for readability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
qdrant_client/_pydantic_compat.py
(1 hunks)qdrant_client/embed/type_inspector.py
(2 hunks)tools/populate_inspection_cache.py
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Python 3.13.x on ubuntu-latest test
- GitHub Check: Python 3.12.x on ubuntu-latest test
- GitHub Check: Python 3.11.x on ubuntu-latest test
- GitHub Check: Python 3.10.x on ubuntu-latest test
- GitHub Check: Python 3.9.x on ubuntu-latest test
🔇 Additional comments (5)
qdrant_client/embed/type_inspector.py (2)
5-5
: Good addition of import from compatibility moduleThis import allows the code to use the
model_fields_set
function from the compatibility layer, which handles differences between Pydantic v1 and v2.
66-66
: Proper implementation of Pydantic version compatibilityReplacing direct access to
member.model_fields_set
withmodel_fields_set(member)
ensures compatibility with both Pydantic v1 and v2. This is essential since in v1, field sets are accessed via__fields_set__
while in v2 they're accessed viamodel_fields_set
.tools/populate_inspection_cache.py (2)
9-9
: Good addition of import from compatibility moduleAdding the import for
model_config
enables the code to use the compatibility function for accessing model configurations consistently across Pydantic versions.
44-45
: Correct implementation of Pydantic version compatibilityReplacing direct access to
model.model_config
withmodel_config(model)
ensures the code works with both Pydantic v1 (which uses__config__
) and v2 (which usesmodel_config
). The subsequent check for the "extra" configuration property is maintained correctly.qdrant_client/_pydantic_compat.py (1)
58-62
: Well-implemented compatibility function for model config accessThe new
model_config
function follows the established pattern in this compatibility module. It correctly handles the difference between Pydantic v1 (where configuration is accessed via__config__
) and v2 (where it's accessed viamodel_config
).The implementation gracefully returns a dictionary representation regardless of the Pydantic version, ensuring consistent behavior throughout the codebase.
✅ Deploy Preview for poetic-froyo-8baba7 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
due to incorrect access to
model_fields_set
the following upsert was failing in pydantic v1