AM-551 less sql in python code