[Typing] Modernize type hints in logger, datasets, and observers by arijitroy003 · Pull Request #2960 · vllm-project/llm-compressor · GitHub
Skip to content

[Typing] Modernize type hints in logger, datasets, and observers - #2960

Merged
kylesayrs merged 3 commits into
vllm-project:mainfrom
arijitroy003:fix/modernize-typing-imports
Sep 11, 2026
Merged

kylesayrs merged 3 commits into
vllm-project:mainfrom
arijitroy003:fix/modernize-typing-imports

Conversation

@arijitroy003

Copy link
Copy Markdown
Contributor

Summary

Modernizes type hints to Python 3.10+ syntax by replacing typing.Optional[X] with X | None and typing.Dict with dict.

This PR complements the existing typing modernization work in PR #2775 by covering additional modules not addressed there.

Changes

  • src/llmcompressor/logger.py: Replaced Optional[str], Optional[int], and Dict[str, Any] with modern syntax
  • src/llmcompressor/datasets/utils.py: Replaced Optional[int] with int | None
  • src/llmcompressor/observers/imatrix.py: Replaced all Optional[torch.Tensor] with torch.Tensor | None

Testing

Changes verified via grep to ensure no old-style typing imports remain in modified files. Type annotations only—no runtime behavior changes.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

@mergify mergify Bot added the two-reviews When a PR requires two reviews label Jul 23, 2026
@mergify

mergify Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 Merge protection satisfied — ready to merge.

Show 1 satisfied protection

🟢 Require one maintainer review

All PRs must have at least one approving review from a maintainer before merging.

  • #changes-requested-reviews-by = 0
  • any of:
    • approved-reviews-by=kylesayrs
    • approved-reviews-by=HDCharles
    • approved-reviews-by=brian-dellabetta
    • approved-reviews-by=dsikka
    • approved-reviews-by=yiliu30

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 modernizes the type hinting across several files, including utils.py, logger.py, and imatrix.py, by replacing typing.Optional and typing.Dict with PEP 604 union syntax (|) and built-in generic types (dict). There are no review comments, and I have no feedback to provide.

@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review.

Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed.

@kylesayrs kylesayrs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks

@kylesayrs
kylesayrs enabled auto-merge (squash) July 27, 2026 04:26
@mergify

mergify Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

The quality checks have failed. Please run make style and make quality under
the root directory to adddress the lint failures. You will need to install the
dev optional install to get the required linting packages:
https://github.com/vllm-project/llm-compressor/blob/main/CONTRIBUTING.md

@kylesayrs

Copy link
Copy Markdown
Collaborator

@arijitroy003 Please make style

@mergify

mergify Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @arijitroy003.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify Bot added the needs-rebase label Aug 19, 2026
Replace typing.Optional[X] with X | None and typing.Dict with dict
following Python 3.10+ syntax. Complements existing typing modernization
work in PR vllm-project#2775 by covering additional modules.

Changed files:
- src/llmcompressor/logger.py
- src/llmcompressor/datasets/utils.py
- src/llmcompressor/observers/imatrix.py

Signed-off-by: arijitroy003 <arijitroy003@gmail.com>
auto-merge was automatically disabled August 25, 2026 10:11

Head branch was pushed to by a user without write access

@arijitroy003
arijitroy003 force-pushed the fix/modernize-typing-imports branch from eb9481d to 3dd71fa Compare August 25, 2026 10:11
@arijitroy003

Copy link
Copy Markdown
Contributor Author

Rebased on main — merge conflicts resolved. This is approved and ready to merge.

@mergify mergify Bot removed the needs-rebase label Aug 25, 2026
@dsikka

dsikka commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

@mergify mergify Bot removed the quality-failed label Aug 25, 2026
@kylesayrs
kylesayrs enabled auto-merge (squash) September 11, 2026 06:11
@kylesayrs kylesayrs added ready When a PR is ready for full CI testing before merge and removed two-reviews When a PR requires two reviews labels Sep 11, 2026
@kylesayrs
kylesayrs merged commit 052d807 into vllm-project:main Sep 11, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready When a PR is ready for full CI testing before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants