Hi,
this is a bit more optimized version of your function:
def retrieve_rows(dataset: Dataset, indexes: Iterable[int], keys:List[str]):
    """Retrieved n rows from the `dataset` for the specific keys."""
    rows = [dataset[i] for i in indexes]
    return [{key: row[key] for key in keys} for row in rows]

Be careful with the dataset[key][index] call because this first loads the entire column into memory, which is OK if the dataset is small.
However, I’d suggest you to use select to select rows because it’s very cheap: it re-uses the underlying Arrow table and creates a file to store indices instead. To keep those indices in memory and not in the file, specify keep_in_memory=True in the select call.
Similarly, a subset of columns can be selected with:
dataset_col_subset = dataset.remove_columns(set(dataset.column_names) - set(keys)) 

If you want, you can access the underlying Arrow table with dataset._data.table.