I have the next query:
sub_qry = self.session.query( TableA.currency, func.sum(func.case([(TableB.status_id == EStatus.REPORTED.value,