def METHOD_NAME(start_tm: str, end_tm: str,
                     key_fields: list, **kwargs):
    """Build filters for predicate pushdown of parquet read"""
    # The time filters first
    timeset = []
    if start_tm and not end_tm:
        timeset = pd.date_range(pd.to_datetime(
            start_tm, infer_datetime_format=True), periods=2,
            freq='15min')
        # pylint: disable=redefined-outer-name
        filters = [[('timestamp', '>=', timeset[0].timestamp()*1000)]]
    elif end_tm and not start_tm:
        timeset = pd.date_range(pd.to_datetime(
            end_tm, infer_datetime_format=True), periods=2,
            freq='15min')
        filters = [[('timestamp', '<=', timeset[-1].timestamp()*1000)]]
    elif start_tm and end_tm:
        timeset = [pd.to_datetime(start_tm, infer_datetime_format=True),
                   pd.to_datetime(end_tm, infer_datetime_format=True)]
        filters = [[('timestamp', '>=', timeset[0].timestamp()*1000),
                    ('timestamp', '<=', timeset[-1].timestamp()*1000)]]
    else:
        filters = []
    # pyarrow's filters are in Disjunctive Normative Form and so filters
    # can get a bit long when lists are present in the kwargs
    # pylint: disable=too-many-nested-blocks
    for k, v in kwargs.items():
        if v and k in key_fields:
            if isinstance(v, list):
                kwdor = []
                for e in v:
                    if not filters:
                        kwdor.append([tuple(('{}'.format(k), '==',
                                             '{}'.format(e)))])
                    else:
                        if len(filters) == 1 and not isinstance(filters[0],
                                                                list):
                            fltcopy = deepcopy(filters)
                            fltcopy.append(tuple(('{}'.format(k), '==',
                                                  '{}'.format(e))))
                            kwdor.append(fltcopy)
                        else:
                            for entry in filters:
                                fltcopy = deepcopy(entry)
                                fltcopy.append(tuple(('{}'.format(k), '==',
                                                      '{}'.format(e))))
                                kwdor.append(fltcopy)
                filters = kwdor
            else:
                if not filters:
                    filters.append(tuple(('{}'.format(k), '==',
                                          '{}'.format(v))))
                else:
                    for entry in filters:
                        entry.append(tuple(('{}'.format(k), '==',
                                            '{}'.format(v))))
    return filters