def get_by_resource_id(*, db_session, resource_id: str) -> Optional[Task]:
    'Get a single task by resource id.'
    return db_session.query(Task).filter((Task.resource_id == resource_id)).first()
Get a single task by resource id.
def get_by_resource_id(*, db_session, resource_id: str) -> Optional[Task]:
    
    return db_session.query(Task).filter((Task.resource_id == resource_id)).first()