Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added check for re.Pattern in Session module #185

Merged
merged 2 commits into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading