Why doesn't an iterable dataset have a column_names featuer?

I feel like it was there in a previous version, but for some reason im getting an error saying dataset.column_names is not defined. Any thoughts?

.column_names is not implemented because in general you need to iterate on the dataset to know the features / column names. e.g.

def gen():
    yield {"foo": 0}

ids = IterableDataset.from_generator(gen)

We could add column_names but either it would be None sometimes, or we would have to always fetch the first rows to know the column names

1 Like