def _create_row_request(table_name, row_key=None, start_key=None, end_key=None, filter_=None, limit=None):
 request_kwargs = {'table_name': table_name}
 if ((row_key is not None) and ((start_key is not None) or (end_key is not None))):
  raise ValueError('Row key and row range cannot be set simultaneously')
 range_kwargs = {}
 if ((start_key is not None) or (end_key is not None)):
  if (start_key is not None):
   range_kwargs['start_key_closed'] = _to_bytes(start_key)
  if (end_key is not None):
   range_kwargs['end_key_open'] = _to_bytes(end_key)
 if (filter_ is not None):
  request_kwargs['filter'] = filter_.to_pb()
 if (limit is not None):
  request_kwargs['rows_limit'] = limit
 message = data_messages_v2_pb2.ReadRowsRequest(**request_kwargs)
 if (row_key is not None):
  message.rows.row_keys.append(_to_bytes(row_key))
 if range_kwargs:
  message.rows.row_ranges.add(**range_kwargs)
 return message

def _create_row_request ( table_name , row_key = None , start_key = None , end_key = None , filter_ = None , limit = None ) : request_kwargs = { 'table_name' : table_name } if ( ( row_key is not None ) and ( ( start_key is not None ) or ( end_key is not None ) ) ) : raise ValueError ( 'Row key and row range cannot be set simultaneously' ) range_kwargs = { } if ( ( start_key is not None ) or ( end_key is not None ) ) : if ( start_key is not None ) : range_kwargs [ 'start_key_closed' ] = _to_bytes ( start_key ) if ( end_key is not None ) : range_kwargs [ 'end_key_open' ] = _to_bytes ( end_key ) if ( filter_ is not None ) : request_kwargs [ 'filter' ] = filter_ . to_pb ( ) if ( limit is not None ) : request_kwargs [ 'rows_limit' ] = limit message = data_messages_v2_pb2 . ReadRowsRequest ( ** request_kwargs ) if ( row_key is not None ) : message . rows . row_keys . append ( _to_bytes ( row_key ) ) if range_kwargs : message . rows . row_ranges . add ( ** range_kwargs ) return message
creates a request to read rows in a table .