diff --git a/src/coscine/metadata.py b/src/coscine/metadata.py index dc1d3cc7acab4e5e8625b852c1c65fffaf566777..6858706e5477293267ace7833c07a547dfc65476 100644 --- a/src/coscine/metadata.py +++ b/src/coscine/metadata.py @@ -685,19 +685,17 @@ class QueryResult: def union(self, files: list[FileObject], attribute: property, column: str) -> list[FileObject]: """ + Computes the union between a list of files, a file (coscine.FileObject) + property and the property reflected in the SPARQL query result + identified via the column it appears in. """ result = [] column_index = self.headers.index(column) for row in self.rows: - found = False for f in files: if f.match(attribute, row[column_index]): result.append(f) - found = True break - if not found: - print(f"Not found for {row[column_index]}") - assert len(result) == len(self.rows) return result def files(self, column: int) -> list[FileObject]: