def _GenerateRangePredicate(self, start_key, end_key, cols):
    predicate = []
    for col in list(cols):
      if start_key[col] != end_key[col]:
        break
      cols.pop(0)
      predicate.append('`%s` = %s' % (
          col, self._dbh.Escape(start_key[col])))
    return ' AND '.join(predicate) or '1'
Generate an equality expression for common values between two keys.
dataset/ETHPy150Open google/mysql-tools/pylib/range_lib.py/PrimaryKeyRange._GenerateRangePredicate