Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More docs to from_dict to mention that the result lives in RAM #7316

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/datasets/arrow_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,12 @@ def from_pandas(
contains `None/nan` objects, the type is set to `null`. This behavior can be avoided by constructing explicit
features and passing it to this function.

Important: a dataset created with from_pandas() lives in memory
and therefore doesn't have an associated cache directory.
This may change in the feature, but in the meantime if you
want to reduce memory usage you should write it back on disk
and reload using using e.g. save_to_disk / load_from_disk.

Args:
df (`pandas.DataFrame`):
Dataframe that contains the dataset.
Expand Down Expand Up @@ -898,6 +904,12 @@ def from_dict(
"""
Convert `dict` to a `pyarrow.Table` to create a [`Dataset`].

Important: a dataset created with from_dict() lives in memory
and therefore doesn't have an associated cache directory.
This may change in the feature, but in the meantime if you
want to reduce memory usage you should write it back on disk
and reload using using e.g. save_to_disk / load_from_disk.

Args:
mapping (`Mapping`):
Mapping of strings to Arrays or Python lists.
Expand Down Expand Up @@ -957,6 +969,12 @@ def from_list(
Note that the keys of the first entry will be used to determine the dataset columns,
regardless of what is passed to features.

Important: a dataset created with from_list() lives in memory
and therefore doesn't have an associated cache directory.
This may change in the feature, but in the meantime if you
want to reduce memory usage you should write it back on disk
and reload using using e.g. save_to_disk / load_from_disk.

Args:
mapping (`List[dict]`): A list of mappings of strings to row values.
features (`Features`, optional): Dataset features.
Expand Down
Loading