def _compare_row_count(schema_name, source_session, target_session, t, logging
    ):
    """
    Compare row counts for a table on different sources.

    Args:
        source_session (obj): Database session.
        target_session (obj): Database session.
        t (obj): SQLAlchemy table object.
    """
    try:
        source_row_ct = source_session.query(t).count()
        target_row_ct = target_session.query(t).count()
    except:
        msg = '{}.{}: Error counting rows.'.format(schema_name, t.name)
        logging.error(msg)
    try:
        if source_row_ct == target_row_ct:
            msg = ('{}.{}: Source and target row count matches ({} rows)'.
                format(schema_name, t.name, source_row_ct))
            logging.info(msg)
        else:
            msg = '{}.{}: Source has {} rows. Target has {} rows.'.format(
                schema_name, t.name, source_row_ct, target_row_ct)
            logging.warning(msg)
    except:
        msg = '{}.{}: Unable to compare row counts.'.format(schema_name, t.name
            )
        logging.error(msg)
