deepaugment/lib/decorators.py
def check_df_arg_nonempty(func):
    """Decorator checks if the DataFrame arguments of the decorated function is not empty

    It throws error and messages the user: if any of the argument who is a DataFrame is empty;
    or if no DataFrame was given
    """

    @wraps(func)
    def wrapper(*args, **kwargs):

        df_args = []
        for arg in args:
            if isinstance(arg, pd.DataFrame):
                df_args.append(arg)

        assert len(df_args) > 0, "No DataFrame argument is entered"

        for df_arg in df_args:
            assert len(df_arg) > 0, "One of DataFrame arguments is empty"

        rv = func(*args, **kwargs)
        return rv

    return wrapper
Decorator checks if the DataFrame arguments of the decorated function is not empty

    It throws error and messages the user: if any of the argument who is a DataFrame is empty;
    or if no DataFrame was given
    
Decorator checks if the DataFrame arguments of the decorated function is not empty
It throws error and messages the user: if any of the argument who is a DataFrame is empty;
or if no DataFrame was given
Decorator checks if the DataFrame arguments of the decorated function is not empty It throws error and messages the user : if any of the argument who is a DataFrame is empty ; or if no DataFrame was given
def check_df_arg_nonempty(func):
    @wraps(func)
    def wrapper(*args, **kwargs):
        df_args = []
        for arg in args:
            if isinstance(arg, pd.DataFrame):
                df_args.append(arg)
        assert len(df_args) > 0, "No DataFrame argument is entered"
        for df_arg in df_args:
            assert len(df_arg) > 0, "One of DataFrame arguments is empty"
        rv = func(*args, **kwargs)
        return rv
    return wrapper
def check_df_arg_nonempty ( func ) : @ wraps ( func ) def wrapper ( * args , ** kwargs ) : df_args = [ ] for arg in args : if isinstance ( arg , pd . DataFrame ) : df_args . append ( arg ) assert len ( df_args ) > 0 , "No DataFrame argument is entered" for df_arg in df_args : assert len ( df_arg ) > 0 , "One of DataFrame arguments is empty" rv = func ( * args , ** kwargs ) return rv return wrapper
Decorator checks if the DataFrame arguments of the decorated function is not empty
It throws error and messages the user: if any of the argument who is a DataFrame is empty;
or if no DataFrame was given
Decorator checks if the DataFrame arguments of the decorated function is not empty It throws error and messages the user : if any of the argument who is a DataFrame is empty ; or if no DataFrame was given
"""Decorator checks if the DataFrame arguments of the decorated function is not empty

    It throws error and messages the user: if any of the argument who is a DataFrame is empty;
    or if no DataFrame was given
    """
func