ZENOTME commented on code in PR #569: URL: https://github.com/apache/iceberg-python/pull/569#discussion_r1946187013
########## pyiceberg/table/__init__.py: ########## @@ -292,7 +303,13 @@ def _apply(self, updates: Tuple[TableUpdate, ...], requirements: Tuple[TableRequ requirement.validate(self.table_metadata) self._updates += updates - self._requirements += requirements + + # For the requirements, it does not make sense to add a requirement more than once + # For example, you cannot assert that the current schema has two different IDs + existing_requirements = {type(requirement) for requirement in self._requirements} + for new_requirement in requirements: + if type(new_requirement) not in existing_requirements: + self._requirements = self._requirements + requirements Review Comment: Hi, I'm not sure why is not `self._requirements = self._requirements + new_requirement` instead of `self._requirements = self._requirements + requirements`. If we meet something like `[requirement1(not in existing_requirements), requirement2(in existing_requirements)]`, looks like this code will include all requirement? Is something or context I miss? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org