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

Dill 3.7 support #6061

Merged
merged 4 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
# Minimum 8.0.0 to be able to use .to_reader()
"pyarrow>=8.0.0",
# For smart caching dataset processing
"dill>=0.3.0,<0.3.7", # tmp pin until next 0.3.7 release: see https://github.com/huggingface/datasets/pull/5166
"dill>=0.3.0,<0.3.8", # tmp pin until dill has official support for determinism see https://github.com/uqfoundation/dill/issues/19
# For performance gains with apache arrow
"pandas",
# for downloading datasets over HTTPS
Expand Down
6 changes: 3 additions & 3 deletions src/datasets/utils/py_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ def save(self, obj, save_persistent_id=True):
def dill_log(pickler, msg):
dill._dill.log.info(msg)

elif config.DILL_VERSION.release[:3] == version.parse("0.3.6").release:
elif config.DILL_VERSION.release[:3] in [version.parse("0.3.6").release, version.parse("0.3.7").release]:

def dill_log(pickler, msg):
dill._dill.logger.trace(pickler, msg)
Expand Down Expand Up @@ -826,7 +826,7 @@ def _save_code(pickler, obj):
dill._dill.log.info("# Co")
return

elif config.DILL_VERSION.release[:3] == version.parse("0.3.6").release:
elif config.DILL_VERSION.release[:3] in [version.parse("0.3.6").release, version.parse("0.3.7").release]:
# From: https://github.com/uqfoundation/dill/blob/dill-0.3.6/dill/_dill.py#L1104
@pklregister(CodeType)
def save_code(pickler, obj):
Expand Down Expand Up @@ -1193,7 +1193,7 @@ def save_function(pickler, obj):
dill._dill.log.info("# F2")
return

elif config.DILL_VERSION.release[:3] == version.parse("0.3.6").release:
elif config.DILL_VERSION.release[:3] in [version.parse("0.3.6").release, version.parse("0.3.7").release]:
# From: https://github.com/uqfoundation/dill/blob/dill-0.3.6/dill/_dill.py#L1739
@pklregister(FunctionType)
def save_function(pickler, obj):
Expand Down