Skip to content
Snippets Groups Projects
Commit b362a8cd authored by Albert Feghaly's avatar Albert Feghaly
Browse files

Expand filtering to all fields

parent 48dd7cdd
No related branches found
No related tags found
No related merge requests found
......@@ -222,12 +222,12 @@ class Client:
""" Get a subset of the available datafiles for which there is a match,
kwargs refer to get_datafiles_list arguments
"""
def filter_datafiles(self, term, exact_match=False, **kwargs):
def filter_datafiles(self, term, field='filename', exact_match=False, **kwargs):
df = self.get_datafiles_list(**kwargs)
if exact_match:
return df[df.filename.str.fullmatch(term)]
return df[df[field].str.fullmatch(term)]
else:
return df[df.filename.str.contains(term)]
return df[df[field].str.contains(term)]
""" Get file content according to file_id """
def get_file(self, file_id):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment