Skip to content

Conversation

@trivialfis
Copy link
Member

No description provided.

@trivialfis trivialfis requested a review from Copilot November 6, 2025 07:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds comprehensive type annotations to test files and demo scripts across the XGBoost codebase. The changes improve code maintainability by making function signatures explicit with return types and parameter types.

Key Changes

  • Added -> None return type annotations to test functions across GPU, Dask, and demo test suites
  • Added type annotations for function parameters (e.g., str, int, bool, Dict, np.ndarray)
  • Updated type hints in sklearn.py to add default value for optional parameter
  • Removed unused imports (os, sys, matplotlib)
  • Consolidated lint paths in ops/script/lint_python.py to use directory-level entries
  • Updated comments and documentation strings

Reviewed Changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_distributed/test_with_dask/test_with_dask.py Added return type -> None and parameter type annotations to test functions, updated type hints for dask collection types
tests/test_distributed/test_with_dask/test_demos.py Added -> None return type to all test functions
tests/python-gpu/test_*.py Added comprehensive type annotations to test methods and functions across multiple GPU test files
tests/python-gpu/conftest.py Added type annotations to pytest fixtures and hooks
python-package/xgboost/sklearn.py Added default value = None to optional sample_weight parameter in protocol definition
ops/script/lint_python.py Consolidated individual file entries into directory-level paths for linting
demo/guide-python/*.py Added type annotations to demo functions and variables

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@trivialfis trivialfis merged commit a591369 into dmlc:master Nov 7, 2025
89 of 92 checks passed
@trivialfis trivialfis deleted the type-hint branch November 7, 2025 06:25
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