diff --git a/python/lsst/daf/butler/queries/relation_tree/_predicate.py b/python/lsst/daf/butler/queries/relation_tree/_predicate.py index a7e2d0ebef..4aa8559f18 100644 --- a/python/lsst/daf/butler/queries/relation_tree/_predicate.py +++ b/python/lsst/daf/butler/queries/relation_tree/_predicate.py @@ -71,8 +71,8 @@ class LogicalAnd(PredicateBase): def gather_required_columns(self) -> set[ColumnReference]: # Docstring inherited. - result = self.operands[0].gather_required_columns() - for operand in self.operands[1:]: + result: set[ColumnReference] = set() + for operand in self.operands: result.update(operand.gather_required_columns()) return result @@ -105,8 +105,8 @@ class LogicalOr(PredicateBase): def gather_required_columns(self) -> set[ColumnReference]: # Docstring inherited. - result = self.operands[0].gather_required_columns() - for operand in self.operands[1:]: + result: set[ColumnReference] = set() + for operand in self.operands: result.update(operand.gather_required_columns()) return result