Skip to content

Type checking for lpipe provided kwargs #45

Description

@Andrew-Wichmann

If an Action doesn't have any required_kwargs and one of it's functions includes a RESERVED_WORD, lpipe will fail because the reserved word is set to None before type checking.

error message:
InvalidPayloadError Failed to run PATH1 Action(functions=[<function func at 0x7f66822c8d08>], paths=[], queues=[]) due to TypeError Type of logger should be <class 'lpipe.logging.LPLogger'> not <class 'NoneType'>.

To replicate:

def func(
    my_arg
    logger: LPLogger,
    **kwargs,
):
    pass

PATHS = {"PATH1": [func]}

To fix:

def func(
    my_arg
    logger: LPLogger,
    **kwargs,
):
    pass

PATHS = {"PATH1": [Action(functions=[func], required_params=["my_arg"])]}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions