From fbbae0b8bc933fbbb9811faeabb9b6d9a0ea8d97 Mon Sep 17 00:00:00 2001 From: glemarivero <54856213+glemarivero@users.noreply.github.com> Date: Sun, 7 Feb 2021 12:12:01 -0300 Subject: [PATCH] Fix Dataset.remove_files() does not match when files are in the root of the dataset (#303) Co-authored-by: Gabriel Lema --- clearml/datasets/dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clearml/datasets/dataset.py b/clearml/datasets/dataset.py index 159068c5..59895286 100644 --- a/clearml/datasets/dataset.py +++ b/clearml/datasets/dataset.py @@ -214,7 +214,7 @@ class Dataset(object): self._dataset_file_entries = { k: v for k, v in self._dataset_file_entries.items() - if not (fnmatch(k, path) and fnmatch(k, '*/' + wildcard))} + if not (fnmatch(k, path) and fnmatch(k if '/' in k else '/{}'.format(k), '*/' + wildcard))} if verbose and org_files: for f in org_files: