-
Notifications
You must be signed in to change notification settings - Fork 15
Start cleaning up unused imports #1035
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
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @rad-cord, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing code quality and maintainability by systematically removing unused imports throughout the project. The changes are primarily driven by stricter enforcement from the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Unit test report (Python 3.9.24, Pydantic 1.10.22)268 tests 268 ✅ 8s ⏱️ Results for commit 18d3608. ♻️ This comment has been updated with latest results. |
Unit test report (Python 3.9.24, Pydantic 2.12.3)268 tests 268 ✅ 8s ⏱️ Results for commit 18d3608. ♻️ This comment has been updated with latest results. |
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.
Code Review
This pull request cleans up unused imports across the codebase, which is a great step for maintainability. Most of the changes are correct and improve code hygiene. However, I've identified a few critical issues that need attention before merging. Several imports marked for 'backwards compatibility' have been removed, which could introduce breaking changes for users of the SDK. Additionally, a change in the COCO exporter incorrectly removes a dependency check, which will degrade the user experience when optional dependencies are missing. I've left detailed comments on these specific points.
|
|
||
| # Following imports need to be here for backwards compatibility | ||
| from encord.objects.ontology_element import NestedID # pylint: disable=unused-import | ||
| from encord.objects.options import ( # pylint: disable=unused-import | ||
| FlatOption, | ||
| NestableOption, | ||
| Option, | ||
| ) |
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.
These imports were marked with pylint: disable=unused-import and a comment indicating they are for backwards compatibility. Removing them could introduce breaking changes for users who rely on these names being available in the encord.objects.common namespace. Please verify that this change is intentional and will not break the public API. If these are indeed no longer needed, it would be good to mention this breaking change in the release notes.
| @@ -1,2 +1 @@ | |||
| # Import for backward compatibility | |||
| from encord.orm.project import ProjectDataset | |||
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.
SDK integration test report285 tests ±0 275 ✅ - 2 15m 39s ⏱️ - 2m 33s For more details on these failures, see this check. Results for commit 18d3608. ± Comparison against base commit dbabc87. ♻️ This comment has been updated with latest results. |
Introduction and Explanation
Enforce unused imports with ruff.
There were a few changes to explicitly re-export items, but otherwise, smooth sailing
Tests
Continue to pass