Reload features from Parquet metadata
CONTRIBUTOR
I'd be happy to have a look, if nobody else has started working on this yet @lhoestq. 

It seems to me that for the `arrow` format features are currently attached as metadata [in `datasets.arrow_writer`](https://github.com/huggingface/datasets/blob/5f810b7011a8a4ab077a1847c024d2d9e267b065/src/datasets/arrow_writer.py#L412)  and retrieved from the metadata at `load_dataset` time using [`datasets.features.features.from_arrow_schema`](https://github.com/huggingface/datasets/blob/5f810b7011a8a4ab077a1847c024d2d9e267b065/src/datasets/features/features.py#L1602). 

This will need to be replicated for `parquet` via calls to [this api](https://arrow.apache.org/docs/python/generated/pyarrow.parquet.write_metadata.html) from `io.parquet.ParquetWriter` and `io.parquet.ParquetReader` [respectively](https://github.com/huggingface/datasets/blob/5f810b7011a8a4ab077a1847c024d2d9e267b065/src/datasets/io/parquet.py#L104).

Any other important considerations?

2023-02-05T17:24:02Z
https://github.com/huggingface/datasets/issues/5482#issuecomment-1418185843
https://api.github.com/repos/huggingface/datasets/issues/5482
IC_kwDODunzps5Uh8xz
https://api.github.com/repos/huggingface/datasets/issues/comments/1418185843/reactions
2023-02-05T17:25:23Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1418185843
https://avatars.githubusercontent.com/u/6368040?v=4
https://api.github.com/users/MFreidank/events{/privacy}
https://api.github.com/users/MFreidank/followers
https://api.github.com/users/MFreidank/following{/other_user}
https://api.github.com/users/MFreidank/gists{/gist_id}
https://github.com/MFreidank
MFreidank
MDQ6VXNlcjYzNjgwNDA=
https://api.github.com/users/MFreidank/orgs
https://api.github.com/users/MFreidank/received_events
https://api.github.com/users/MFreidank/repos
https://api.github.com/users/MFreidank/starred{/owner}{/repo}
https://api.github.com/users/MFreidank/subscriptions
User
https://api.github.com/users/MFreidank
public
MEMBER
Thanks @MFreidank ! That's correct :)

Reading the metadata to infer the features can be ideally done in the `parquet.py` file in `packaged_builder` when a parquet file is read. You can cast the arrow table to the schema you get from the features.arrow_schema
2023-02-05T18:09:54Z
https://github.com/huggingface/datasets/issues/5482#issuecomment-1418204426
https://api.github.com/repos/huggingface/datasets/issues/5482
IC_kwDODunzps5UiBUK
https://api.github.com/repos/huggingface/datasets/issues/comments/1418204426/reactions
2023-02-05T18:09:54Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1418204426
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
CONTRIBUTOR
#self-assign
2023-02-09T09:09:36Z
https://github.com/huggingface/datasets/issues/5482#issuecomment-1423858612
https://api.github.com/repos/huggingface/datasets/issues/5482
IC_kwDODunzps5U3lu0
https://api.github.com/repos/huggingface/datasets/issues/comments/1423858612/reactions
2023-02-09T09:09:36Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1423858612
https://avatars.githubusercontent.com/u/6368040?v=4
https://api.github.com/users/MFreidank/events{/privacy}
https://api.github.com/users/MFreidank/followers
https://api.github.com/users/MFreidank/following{/other_user}
https://api.github.com/users/MFreidank/gists{/gist_id}
https://github.com/MFreidank
MFreidank
MDQ6VXNlcjYzNjgwNDA=
https://api.github.com/users/MFreidank/orgs
https://api.github.com/users/MFreidank/received_events
https://api.github.com/users/MFreidank/repos
https://api.github.com/users/MFreidank/starred{/owner}{/repo}
https://api.github.com/users/MFreidank/subscriptions
User
https://api.github.com/users/MFreidank
public
The idea would be to allow this :
```python 
ds.to_parquet("my_dataset/ds.parquet")
reloaded = load_dataset("my_dataset")
assert ds.features == reloaded.features 
```
And it should also work with Image and Audio types (right now they're reloaded as a dict type)

This can be implemented by storing and reading the feature types in the parquet metadata, as we do for arrow files.