Skip to content

Commit f7c8e46

Browse files
authored
fix: better args passthrough for _batch_setitems() (#7817)
* update signature for _batch_setitems * arguments passthrough
1 parent 6d985d9 commit f7c8e46

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/datasets/utils/_dill.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ def save(self, obj, save_persistent_id=True):
6969
obj = getattr(obj, "_torchdynamo_orig_callable", obj)
7070
dill.Pickler.save(self, obj, save_persistent_id=save_persistent_id)
7171

72-
def _batch_setitems(self, items):
73-
if self._legacy_no_dict_keys_sorting:
74-
return super()._batch_setitems(items)
72+
def _batch_setitems(self, items, *args, **kwargs):
7573
# Ignore the order of keys in a dict
7674
try:
7775
# Faster, but fails for unorderable elements
@@ -80,7 +78,7 @@ def _batch_setitems(self, items):
8078
from datasets.fingerprint import Hasher
8179

8280
items = sorted(items, key=lambda x: Hasher.hash(x[0]))
83-
dill.Pickler._batch_setitems(self, items)
81+
return super()._batch_setitems(items, *args, **kwargs)
8482

8583
def memoize(self, obj):
8684
# Don't memoize strings since two identical strings can have different Python ids

0 commit comments

Comments
 (0)