Python Functions With Optional Parameters In Sql