Skip to content

Conversation

@CRZbulabula
Copy link
Contributor

Refactor the exception throw for clear error handling.

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 PR refactors exception handling in the AINode model management system to provide clearer and more accurate error reporting. The changes involve renaming classes and methods for consistency, reorganizing error status codes, and improving exception handling patterns across both Java and Python codebases.

Key changes include:

  • Renamed "Training" terminology to "Tuning" to better reflect the operation's purpose (TTrainingReq → TTuningReq, CreateTrainingTask → CreateTuningTask, etc.)
  • Standardized Python exception naming from "*Error" suffix to "*Exception" suffix across the entire AINode codebase
  • Reorganized TSStatusCode enum with more specific error codes (MODEL_EXISTED_ERROR, MODEL_NOT_EXIST_ERROR, CREATE_MODEL_ERROR, DROP_BUILTIN_MODEL_ERROR, etc.) replacing generic codes
  • Improved error messages and validation (e.g., "Device ID" → "AIDevice ID" for consistency)
  • Removed unused ModelNotFoundException class and methods (get_model_infos, get_registered_models)
  • Refactored model storage methods with better documentation and moved helper functions to utils module

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 26 comments.

Show a summary per file
File Description
ainode.thrift Renamed TTrainingReq to TTuningReq and createTrainingTask to createTuningTask; reorganized service method ordering
CreateTuningTask.java Renamed class and constructors from CreateTrainingTask to CreateTuningTask
IConfigTaskExecutor.java Renamed createTraining method to createTuningTask
ClusterConfigTaskExecutor.java Updated imports and method names; improved variable naming (ai → aiNodeClient)
TreeConfigTaskVisitor.java Updated imports to use CreateTuningTask
TableConfigTaskVisitor.java Updated imports and instantiation to use CreateTuningTask
AINodeClient.java Updated imports and method signature for createTuningTask
ModelNotFoundException.java Deleted file - no longer needed
GetModelInfoException.java Changed to use AINODE_INTERNAL_ERROR status code
serde.py Renamed BadConfigValueError to BadConfigValueException
handler.py Renamed exception references; reorganized methods with section comments; improved error codes and messages
utils.py Added _fetch_model_from_local and _fetch_model_from_hf_repo helper functions; improved exception handling
pipeline_timer.py Renamed InferenceModelInternalError to InferenceModelInternalException
pipeline_sundial.py Renamed InferenceModelInternalError to InferenceModelInternalException
modeling_sktime.py Renamed BuiltInModelNotSupportError and InferenceModelInternalError to Exception suffix
configuration_sktime.py Renamed WrongAttributeTypeError and BuiltInModelNotSupportError to Exception suffix
model_storage.py Refactored register_model and delete_model with better error handling; removed unused methods; improved documentation
model_loader.py Renamed ModelNotExistError to ModelNotExistException
utils.py (manager) Renamed ModelNotExistError to ModelNotExistException
model_manager.py Updated exception handling with specific exception types and status codes
inference_manager.py Renamed InferenceModelInternalError to InferenceModelInternalException
basic_pool_scheduler.py Renamed InferenceModelInternalError to InferenceModelInternalException
pool_group.py Renamed InferenceModelInternalError to InferenceModelInternalException
pool_controller.py Renamed InferenceModelInternalError to InferenceModelInternalException
basic_dispatcher.py Renamed InferenceModelInternalError to InferenceModelInternalException
exception.py Renamed all exception classes from *Error to *Exception; added new model-specific exceptions; reorganized with section comments
constant.py Reorganized TSStatusCode enum with more specific AI error codes; removed HyperparameterName enum
config.py Renamed BadNodeUrlError to BadNodeUrlException
TSStatusCode.java Reorganized AI error codes (1500-1599 range) with more specific codes
AINodeClusterConfigIT.java Removed TODO comment

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

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

Copilot reviewed 31 out of 31 changed files in this pull request and generated 3 comments.


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

@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

❌ Patch coverage is 58.82353% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.02%. Comparing base (94461b0) to head (a553cb6).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ion/config/executor/ClusterConfigTaskExecutor.java 0.00% 2 Missing ⚠️
...tdb/db/exception/ainode/GetModelInfoException.java 0.00% 1 Missing ⚠️
...ache/iotdb/db/protocol/client/an/AINodeClient.java 0.00% 1 Missing ⚠️
.../plan/execution/config/TableConfigTaskVisitor.java 0.00% 1 Missing ⚠️
...e/plan/execution/config/TreeConfigTaskVisitor.java 0.00% 1 Missing ⚠️
...execution/config/metadata/ai/CreateTuningTask.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master   #16895   +/-   ##
=========================================
  Coverage     39.02%   39.02%           
  Complexity      207      207           
=========================================
  Files          5022     5021    -1     
  Lines        333375   333373    -2     
  Branches      42431    42431           
=========================================
+ Hits         130105   130106    +1     
+ Misses       203270   203267    -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CRZbulabula CRZbulabula merged commit c722aaf into master Dec 11, 2025
32 checks passed
@CRZbulabula CRZbulabula deleted the more-accurate-exceptions branch December 11, 2025 08:32
JackieTien97 pushed a commit that referenced this pull request Dec 16, 2025
JackieTien97 pushed a commit that referenced this pull request Dec 16, 2025
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.

1 participant