Skip to content

Feature | cast tasks arguments and values loaded through .env files to the correct type #21

Open
@angelofenoglio

Description

@angelofenoglio

What

Currently all parameters that a user provides to run a specific task are treated as strings. When these values are passed to the task during its invocation, they are still strings.
e.g.: in leverage task1[3,cleaup=True], task1 will be invoked with arguments "3" and cleanup: "True"
The burden of interpreting these string values correctly is up to the developer that writes such tasks.

The same happens with values loaded from .env files when using conf.load() in a task.

The proposal is to try and cast these input values into their correct data type.
To avoid challenging border cases maybe only a couple of types could be initially supported, such as booleans, integers and floats, and let everything that cannot be converted into these types be a string.

Why

It will ease the tasks developer job since it is a very repeatitive and error prone chore.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions