Skip to content

Deprecation warnings are shown even if the field is not accessed in the task #86

Description

@poautran

In GitLab by @loichuder on Feb 12, 2026, 17:38 GMT+1:

When marking a field as deprecated using Pydantic deprecated mechanism, a warning is always printed even if the field is not accessed.

from pydantic import Field

from ewoks import BaseInputModel, Task


class Inputs(BaseInputModel):
    a: int
    b: int = Field(deprecated="DO NOT USE B", default=2)


class TheTask(Task, input_model=Inputs, output_names=["result"]):
    def run(self):
        self.outputs.result = self.inputs.a


task = TheTask(inputs={"a": 2})
task.execute()

Migrated from GitLab: https://gitlab.esrf.fr/workflow/ewoks/ewokscore/-/issues/86

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions