Skip to content

Commit a17813b

Browse files
Nic-Mamonai-bot
andauthored
Enhance deprecated arg for kwargs in CSV datasets (#3446)
* [DLMED] fix deprecated arg Signed-off-by: Nic Ma <[email protected]> * [MONAI] python code formatting Signed-off-by: monai-bot <[email protected]> Co-authored-by: monai-bot <[email protected]>
1 parent 8a47227 commit a17813b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

monai/data/dataset.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,6 +1276,9 @@ def __init__(
12761276
else:
12771277
raise ValueError("`src` must be file path or pandas `DataFrame`.")
12781278

1279+
# in case treating deprecated arg `filename` as kwargs, remove it from `kwargs`
1280+
kwargs.pop("filename", None)
1281+
12791282
data = convert_tables_to_dicts(
12801283
dfs=dfs, row_indices=row_indices, col_names=col_names, col_types=col_types, col_groups=col_groups, **kwargs
12811284
)

monai/data/iterable_dataset.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,10 @@ def __init__(
205205
self.col_groups = col_groups
206206
self.shuffle = shuffle
207207
self.seed = seed
208+
# in case treating deprecated arg `filename` as kwargs, remove it from `kwargs`
209+
kwargs.pop("filename", None)
208210
self.kwargs = kwargs
211+
209212
self.iters: List[Iterable] = self.reset()
210213
super().__init__(data=None, transform=transform) # type: ignore
211214

0 commit comments

Comments
 (0)