diff --git a/monai/data/dataset.py b/monai/data/dataset.py index f0416a6bdb..38371f384b 100644 --- a/monai/data/dataset.py +++ b/monai/data/dataset.py @@ -1276,6 +1276,9 @@ def __init__( else: raise ValueError("`src` must be file path or pandas `DataFrame`.") + # in case treating deprecated arg `filename` as kwargs, remove it from `kwargs` + kwargs.pop("filename", None) + data = convert_tables_to_dicts( dfs=dfs, row_indices=row_indices, col_names=col_names, col_types=col_types, col_groups=col_groups, **kwargs ) diff --git a/monai/data/iterable_dataset.py b/monai/data/iterable_dataset.py index e463c8c6ed..4eca6cdec9 100644 --- a/monai/data/iterable_dataset.py +++ b/monai/data/iterable_dataset.py @@ -205,7 +205,10 @@ def __init__( self.col_groups = col_groups self.shuffle = shuffle self.seed = seed + # in case treating deprecated arg `filename` as kwargs, remove it from `kwargs` + kwargs.pop("filename", None) self.kwargs = kwargs + self.iters: List[Iterable] = self.reset() super().__init__(data=None, transform=transform) # type: ignore