Skip to content

Conversation

Copy link

Copilot AI commented Nov 18, 2025

LocalExecutionSettings in annotation_pipeline.py defines logging_dir: Optional[str] without a default value, causing Pydantic to require it. Users encounter validation errors when omitting it from configs.

Changes

  • annotation_pipeline.py: Add default values to LocalExecutionSettings fields to match embedding_pipeline.py:

    class LocalExecutionSettings(BaseModel):
        tasks: int = 1
        local_tasks: int = 1
        local_rank_offset: int = 0
        workers: int = -1
        logging_dir: str | None = None  # Was: Optional[str] (required)
  • test_local_execution_settings.py: Add test coverage for instantiation with and without logging_dir

The existing set_logging_dir validator continues to auto-populate logging_dir as {output_dir}/logs when None.

Original prompt

Why I do get the error:

LocalExecutionSettings(**local_section)
Traceback (most recent call last):
File "", line 1, in
File "/raid/s3/opengptx/mehdi-ali/git_repos/ml_filter/mlfilter_venv/lib/python3.11/site-packages/pydantic/main.py", line 253, in init
validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for LocalExecutionSettings
logging_dir
Field required [type=missing, input_value={'tasks': 1, 'local_tasks...ffset': 0, 'workers': 4}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.11/v/missing
LocalExecutionSettings(**local_section)
Traceback (most recent call last):
File "", line 1, in
File "/raid/s3/opengptx/mehdi-ali/git_repos/ml_filter/mlfilter_venv/lib/python3.11/site-packages/pydantic/main.py", line 253, in init
validated_self = self.pydantic_validator.validate_python(data, self_instance=self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.ValidationError: 1 validation error for LocalExecutionSettings
logging_dir
Field required [type=missing, input_value={'tasks': 1, 'local_tasks...ffset': 0, 'workers': 4}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.11/v/missing

Created from VS Code via the GitHub Pull Request extension.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Nov 18, 2025
@mali-git mali-git closed this Nov 18, 2025
@mali-git mali-git deleted the copilot/fix-missing-logging-dir branch November 18, 2025 13:53
Copilot AI changed the title [WIP] Fix validation error for LocalExecutionSettings due to missing logging_dir Fix Pydantic validation error: make LocalExecutionSettings.logging_dir optional Nov 18, 2025
Copilot AI requested a review from mali-git November 18, 2025 14:01
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