Querywrapper Not Null Lambda Function In Python