Python Check Array Is Not Empty Sql