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

Method _set_target_column

lib/sqlalchemy/sql/schema.py:3174–3190  ·  view source on GitHub ↗
(self, column: Column[Any])

Source from the content-addressed store, hash-verified

3172 return _column
3173
3174 def _set_target_column(self, column: Column[Any]) -> None:
3175 assert self.parent is not None
3176
3177 # propagate TypeEngine to parent if it didn't have one
3178 if self.parent.type._isnull:
3179 self.parent.type = column.type
3180
3181 # super-edgy case, if other FKs point to our column,
3182 # they'd get the type propagated out also.
3183
3184 def set_type(fk: ForeignKey) -> None:
3185 if fk.parent.type._isnull:
3186 fk.parent.type = column.type
3187
3188 self.parent._setup_on_memoized_fks(set_type)
3189
3190 self.column = column # type: ignore
3191
3192 @util.ro_memoized_property
3193 def column(self) -> Column[Any]:

Callers 2

_set_remote_tableMethod · 0.95
_set_tableMethod · 0.95

Calls 1

Tested by

no test coverage detected