Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Pass function kwargs into the check function? #77

@josh-gree

Description

@josh-gree

Hi great project thanks very much!

I have the following use case and I am wondering if it can perhaps already be achieved? I have taken a look at the source and not sure that it can be! Maybe what I want to do is crazy!?

I have some function;

def foo(date: datetime.date) -> DataFrame:
    df = call_to_an_external_api(date)
    return df

The particular api is supposed to respond with data for only a single day specified by date - however sometimes data from days either side leak in - I would like to check that a column of df is unique and that all its values are date. However I don't know date until the function is called.

Could it be possible for a check decorator to pass in the decorated functions args in some way so this could be possible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions