-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
quality_control: remove imports that were deprecated in Python 3.9 #8681
Conversation
WalkthroughThe changes in this pull request involve updates to type hints and import statements in the Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🔇 Additional comments (5)cvat/apps/quality_control/models.py (2)
The change to import Also applies to: 10-10 Line range hint The type hints added for Django model fields look correct, but let's verify they work well with Django's type system and ORM. These fields are likely populated through Django's related_name mechanism:
Let's check if similar type hints are used elsewhere in the codebase: Also applies to: 90-90, 102-102, 103-103, 157-157, 158-158 ✅ Verification successfulLet me gather more information about Django's type hint usage in the codebase, particularly focusing on related fields and their type annotations. Type hints are correctly used and consistent with Django patterns The type hints using
The type hints will work well with Django's type system and ORM, as they follow established patterns in the codebase. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for similar Django model field type hints
rg -U "class.*\(models\.Model\):(\n|.)*?Sequence\[.*?\]" --type py
# Search for any typing-related imports in Django model files
rg "^from collections.abc import|^from typing import" $(rg -l "class.*\(models\.Model\)" --type py)
Length of output: 2069 Script: #!/bin/bash
# Search for type hints on Django related fields
ast-grep --pattern 'class $CLASS(models.Model):
$$$
$_: $TYPE
$$$'
# Look for any typing-related documentation or configuration
fd "typing|mypy" --type f --exec rg -l "django|models"
Length of output: 16084 cvat/apps/quality_control/quality_reports.py (3)
The change to import
The changes consistently update type hints from Also applies to: 164-164, 180-180, 242-242, 414-414, 470-470, 485-485, 538-538, 541-541, 545-545
The changes are purely type hint modernization, updating from Also applies to: 963-963, 998-998, 1145-1145, 1748-1748, 1760-1760, 2376-2376, 2388-2388, 2453-2453, 2460-2460, 2537-2537 Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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 (
|
Quality Gate passedIssues Measures |
@zhiltsov-max Let me know if this conflicts with any patches you plan to merge soon; I can delay merging this patch and rebase it afterwards if necessary. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8681 +/- ##
===========================================
- Coverage 74.24% 74.19% -0.05%
===========================================
Files 401 401
Lines 43502 43504 +2
Branches 3950 3950
===========================================
- Hits 32296 32277 -19
- Misses 11206 11227 +21
|
…vat-ai#8681) This is a continuation of cvat-ai#8626.
Motivation and context
This is a continuation of #8626.
How has this been tested?
Checklist
develop
branch[ ] I have created a changelog fragment[ ] I have updated the documentation accordingly[ ] I have added tests to cover my changes[ ] I have linked related issues (see GitHub docs)[ ] I have increased versions of npm packages if it is necessary(cvat-canvas,
cvat-core,
cvat-data and
cvat-ui)
License
Feel free to contact the maintainers if that's a concern.
Summary by CodeRabbit
New Features
Bug Fixes