Skip to content

Remove extra config validation#652

Merged
guarin merged 2 commits intomainfrom
remove-extra-validate
Mar 20, 2026
Merged

Remove extra config validation#652
guarin merged 2 commits intomainfrom
remove-extra-validate

Conversation

@guarin
Copy link
Copy Markdown
Contributor

@guarin guarin commented Mar 19, 2026

What has changed and why?

  • Remove extra config validation

Removes an extra config validation step which converted all configs to TrainTaskConfig. The extra validation is no longer necessary as we already validate the config in _train_task (5 lines above the change). The extra validation also resulted in all config classes getting converted to TrainTaskConfig instances instead of keeping their original class, e.g. ObjectDetectionConfig. This didn't result in any bugs because we never rely on the instance type of the config but avoiding the conversion is clearly the better solution and prevents future bugs.

How has it been tested?

  • Manually

Did you update CHANGELOG.md?

  • Yes
  • Not needed (internal change)

Did you update the documentation?

  • Yes
  • Not needed (internal change without effects for user)

@guarin guarin marked this pull request as ready for review March 20, 2026 10:13
Copilot AI review requested due to automatic review settings March 20, 2026 10:13
@guarin
Copy link
Copy Markdown
Contributor Author

guarin commented Mar 20, 2026

/review

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

Removes a redundant second Pydantic validation/conversion step in the training command flow so the original config model type (e.g., ObjectDetectionConfig) is preserved, relying on the existing validation already performed in _train_task.

Changes:

  • Removed re-validation/re-construction of config into TrainTaskConfig inside _train_task_from_config.
  • Ensures the config instance type remains the specific config_cls produced by _train_task validation.

@guarin guarin enabled auto-merge (squash) March 20, 2026 12:04
@guarin guarin merged commit 73979fa into main Mar 20, 2026
15 checks passed
@guarin guarin deleted the remove-extra-validate branch March 20, 2026 12:32
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.

3 participants