Skip to content

Commit

Permalink
Merge pull request #185 from radical-cybertools/fix/issue_183
Browse files Browse the repository at this point in the history
added check for `re.Pattern` in `Session` module
  • Loading branch information
mtitov authored Nov 3, 2023
2 parents 67305b4 + 0dcdc5d commit 08d75b7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/radical/analytics/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,14 +491,21 @@ def _apply_filter(self, etype=None, uid=None, state=None,
time = ru.as_list(time )

ret = list()
for eid,entity in list(self._entities.items()):
for eid, entity in list(self._entities.items()):

if etype and entity.etype not in etype: continue

if uids:
try:
re_pattern = re.Pattern
except AttributeError:
re_pattern = None
self._log.warn('re.Pattern is not supported within this '
'python version')

keep = False
for uid in uids:
if isinstance(uid, re.Pattern):
if re_pattern and isinstance(uid, re_pattern):
# uid is actually a regex we use for matching
if uid.match(entity.uid):
keep = True
Expand Down

0 comments on commit 08d75b7

Please sign in to comment.