Skip to content

Commit

Permalink
Dill 3.7 support (#6061)
Browse files Browse the repository at this point in the history
* Dill 3.7 support

* Nit

* Update setup.py

Co-authored-by: Quentin Lhoest <[email protected]>

* Nit

---------

Co-authored-by: Quentin Lhoest <[email protected]>
  • Loading branch information
mariosasko and lhoestq authored Jul 24, 2023
1 parent 4200443 commit ae126ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit ae126ac

Please sign in to comment.