MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _reset_column_collection

Method _reset_column_collection

lib/sqlalchemy/sql/selectable.py:1015–1030  ·  view source on GitHub ↗

Reset the attributes linked to the ``FromClause.c`` attribute. This collection is separate from all the other memoized things as it has shown to be sensitive to being cleared out in situations where enclosing code, typically in a replacement traversal scenario, has a

(self)

Source from the content-addressed store, hash-verified

1013 return self.foreign_keys
1014
1015 def _reset_column_collection(self) -> None:
1016 """Reset the attributes linked to the ``FromClause.c`` attribute.
1017
1018 This collection is separate from all the other memoized things
1019 as it has shown to be sensitive to being cleared out in situations
1020 where enclosing code, typically in a replacement traversal scenario,
1021 has already established strong relationships
1022 with the exported columns.
1023
1024 The collection is cleared for the case where a table is having a
1025 column added to it as well as within a Join during copy internals.
1026
1027 """
1028
1029 for key in ["_columns", "columns", "c", "primary_key", "foreign_keys"]:
1030 self.__dict__.pop(key, None)
1031
1032 @util.ro_non_memoized_property
1033 def _select_iterable(self) -> _SelectIterable:

Callers 2

_copy_internalsMethod · 0.80

Calls 1

popMethod · 0.45

Tested by

no test coverage detected