"""HFA related model.""" from product.connectors import mysql from product.models.sql.hfa_pending_tracks import ( HFA_ELIGIBLE_TRACKS ) def get_hfa_eligible_tracks() -> list[dict]: """Execute a SQL query and return the result.""" try: with mysql.db_session() as session: result_proxy = session.execute(HFA_ELIGIBLE_TRACKS) results = [dict(row) for row in result_proxy.mappings().all()] if not results: return [] return results except Exception as e: raise RuntimeError( f"Query execution failed: {HFA_ELIGIBLE_TRACKS[:100]}. Exception args: {e.args}" ) from e