Skip to content

Conversation

@rad-cord
Copy link
Collaborator

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

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 ruff linter, ensuring that the codebase adheres to better hygiene standards. This effort streamlines dependencies, clarifies module interfaces, and prepares the project for more robust static analysis.

Highlights

  • Unused Import Removal: Numerous unused imports have been removed across the codebase, improving code cleanliness and reducing potential for confusion.
  • Ruff Enforcement: The ruff linter is now more strictly enforcing unused imports, as indicated by the removal of per-file-ignores for F401 (unused imports) in pyproject.toml.
  • Explicit Re-exports: Some modules, such as encord/common/bitmask_operations/__init__.py and encord/orm/base_dto/__init__.py, have had their __all__ lists updated to explicitly define what symbols are re-exported, ensuring intended public APIs are maintained.
  • Import Path Adjustments: A few imports, like SkeletonTemplateCoordinate in test files, have been adjusted to point to their correct or more specific module locations.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Nov 27, 2025

Unit test report (Python 3.9.24, Pydantic 1.10.22)

268 tests   268 ✅  8s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 18d3608.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Nov 27, 2025

Unit test report (Python 3.9.24, Pydantic 2.12.3)

268 tests   268 ✅  8s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 18d3608.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

Comment on lines 14 to 21

# 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,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The comment indicates this import of ProjectDataset is for backward compatibility. Removing it could be a breaking change. Please ensure this is intended and won't affect users relying on this import path.

@github-actions
Copy link

github-actions bot commented Nov 27, 2025

SDK integration test report

285 tests  ±0   275 ✅  - 2   15m 39s ⏱️ - 2m 33s
  1 suites ±0     4 💤 ±0 
  1 files   ±0     6 ❌ +2 

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants