File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -214,7 +214,6 @@ def from_dataset(
214
214
>>> from_dataset(ds)
215
215
ListDataset(len=4)
216
216
MapDataset(_pickle.loads)
217
- >>> list(ds.items())
218
217
219
218
"""
220
219
try :
@@ -434,7 +433,10 @@ def copy(self, freeze: bool = False) -> 'Dataset':
434
433
Returns:
435
434
A copy of this dataset
436
435
"""
437
- raise NotImplementedError
436
+ raise NotImplementedError (
437
+ f'copy is not implemented for { self .__class__ } .\n '
438
+ f'self: \n { repr (self )} '
439
+ )
438
440
439
441
def __iter__ (self , with_key = False ):
440
442
if with_key :
@@ -2706,8 +2708,8 @@ def __iter__(self, with_key=False):
2706
2708
if with_key :
2707
2709
try :
2708
2710
self .keys ()
2709
- except AssertionError :
2710
- raise _ItemsNotDefined (self .__class__ .__name__ ) from None
2711
+ except AssertionError as e :
2712
+ raise _ItemsNotDefined (self .__class__ .__name__ ) from e
2711
2713
2712
2714
for input_dataset in self .input_datasets :
2713
2715
if with_key :
@@ -2996,6 +2998,7 @@ def __init__(self, *input_datasets):
2996
2998
]
2997
2999
raise AssertionError (
2998
3000
f'Expect that all input_datasets have the same keys. '
3001
+ f'Missing: { lengths } of { len (keys )} \n '
2999
3002
f'Missing keys: '
3000
3003
f'{ missing_keys } \n { self .input_datasets } '
3001
3004
)
You can’t perform that action at this time.
0 commit comments