Converted another data fn to SQLAlchemy
PEP8