Skip to content

Commit

Permalink
docs: cloudpickle is an interesting extension of the pickle functiona…
Browse files Browse the repository at this point in the history
…lity (#361)

Signed-off-by: H. Felix Wittmann <hfwittmann@gmail.com>
  • Loading branch information
hfwittmann authored Oct 10, 2023
1 parent 78913d8 commit 527706d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kedro-datasets/RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# Upcoming Release
## Major features and improvements
## Bug fixes and other changes
* Updated `PickleDataset` to explicitly mention `cloudpickle` support.
## Upcoming deprecations for Kedro-Datasets 2.0.0

## Community contributions
Many thanks to the following Kedroids for contributing PRs to this release:
* [Felix Wittmann](https://github.com/hfwittmann)

# Release 1.7.1
## Bug fixes and other changes
* Pin `tables` version on `kedro-datasets` for Python < 3.8.

## Upcoming deprecations for Kedro-Datasets 2.0.0
* Renamed dataset and error classes, in accordance with the [Kedro lexicon](https://github.com/kedro-org/kedro/wiki/Kedro-documentation-style-guide#kedro-lexicon). Dataset classes ending with "DataSet" are deprecated and will be removed in 2.0.0.

## Community contributions

# Release 1.7.0:
## Major features and improvements
* Added `polars.GenericDataSet`, a `GenericDataSet` backed by [polars](https://www.pola.rs/), a lightning fast dataframe package built entirely using Rust.
Expand Down
4 changes: 4 additions & 0 deletions kedro-datasets/kedro_datasets/pickle/pickle_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ def __init__( # noqa: PLR0913
dill.load: https://dill.readthedocs.io/en/latest/index.html#dill.load
compress_pickle.load:
https://lucianopaz.github.io/compress_pickle/html/api/compress_pickle.html#compress_pickle.compress_pickle.load
cloudpickle.load:
https://github.com/cloudpipe/cloudpickle/blob/0f330b6afe55313fc1efc090a7d350f5ad5c9317/tests/cloudpickle_test.py
All defaults are preserved.
save_args: Pickle options for saving pickle files.
You can pass in arguments that the backend dump function specified accepts, e.g:
Expand All @@ -118,6 +120,8 @@ def __init__( # noqa: PLR0913
dill.dump: https://dill.readthedocs.io/en/latest/index.html#dill.dump
compress_pickle.dump:
https://lucianopaz.github.io/compress_pickle/html/api/compress_pickle.html#compress_pickle.compress_pickle.dump
cloudpickle.dump:
https://github.com/cloudpipe/cloudpickle/blob/0f330b6afe55313fc1efc090a7d350f5ad5c9317/tests/cloudpickle_test.py
All defaults are preserved.
version: If specified, should be an instance of
``kedro.io.core.Version``. If its ``load`` attribute is
Expand Down
5 changes: 5 additions & 0 deletions kedro-datasets/kedro_datasets/redis/redis_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def __init__( # noqa: PLR0913
* `pickle`
* `dill`
* `compress_pickle`
* `cloudpickle`
Example backends that are incompatible:
* `torch`
Expand All @@ -94,13 +95,17 @@ def __init__( # noqa: PLR0913
dill.loads: https://dill.readthedocs.io/en/latest/index.html#dill.loads
compress_pickle.loads:
https://lucianopaz.github.io/compress_pickle/html/api/compress_pickle.html#compress_pickle.compress_pickle.loads
cloudpickle.loads:
https://github.com/cloudpipe/cloudpickle/blob/0f330b6afe55313fc1efc090a7d350f5ad5c9317/tests/cloudpickle_test.py
All defaults are preserved.
save_args: Pickle options for saving pickle files.
You can pass in arguments that the backend dump function specified accepts, e.g:
pickle.dumps: https://docs.python.org/3/library/pickle.html#pickle.dump
dill.dumps: https://dill.readthedocs.io/en/latest/index.html#dill.dumps
compress_pickle.dumps:
https://lucianopaz.github.io/compress_pickle/html/api/compress_pickle.html#compress_pickle.compress_pickle.dumps
cloudpickle.dumps:
https://github.com/cloudpipe/cloudpickle/blob/0f330b6afe55313fc1efc090a7d350f5ad5c9317/tests/cloudpickle_test.py
All defaults are preserved.
credentials: Credentials required to get access to the redis server.
E.g. `{"password": None}`.
Expand Down
1 change: 1 addition & 0 deletions kedro-datasets/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def _collect_requirements(requires):
"biopython~=1.73",
"blacken-docs==1.9.2",
"black~=22.0",
"cloudpickle<=2.0.0",
"compress-pickle[lz4]~=2.1.0",
"coverage[toml]",
"dask[complete]~=2021.10", # pinned by Snyk to avoid a vulnerability
Expand Down
1 change: 1 addition & 0 deletions kedro-datasets/tests/pickle/test_pickle_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class TestPickleDataset:
("pickle", None, None),
("joblib", None, None),
("dill", None, None),
("cloudpickle", None, None),
("compress_pickle", {"compression": "lz4"}, {"compression": "lz4"}),
],
indirect=True,
Expand Down
1 change: 1 addition & 0 deletions kedro-datasets/tests/redis/test_redis_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class TestPickleDataset:
[
("a", "pickle", None, None),
(1, "dill", None, None),
(2, "cloudpickle", None, None),
("key", "compress_pickle", {"compression": "lz4"}, {"compression": "lz4"}),
],
indirect=True,
Expand Down

0 comments on commit 527706d

Please sign in to comment.