Merge pull request #32933 from sagarvora/perf-append

This commit is contained in:
Sagar Vora 2025-06-13 20:30:40 +00:00 committed by GitHub
commit 7d8e70e1ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1982,8 +1982,8 @@ class LazyDocument:
@override
def append(self, key: str, value: D | dict | None = None, position: int = -1) -> D:
# Ensure that table descriptor is triggered at least once
if isinstance(key, str) and key in self._table_fieldnames:
getattr(self, key, None)
# key is assumed to be a table fieldname (as expected by BaseDocument.append)
getattr(self, key, None)
return super().append(key, value, position)
@override