MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _set_target_column

Method _set_target_column

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

Source from the content-addressed store, hash-verified

3475 return _column
3476
3477 def _set_target_column(self, column: Column[Any]) -> None:
3478 assert self.parent is not None
3479
3480 # propagate TypeEngine to parent if it didn't have one
3481 if self.parent.type._isnull:
3482 self.parent.type = column.type
3483
3484 # super-edgy case, if other FKs point to our column,
3485 # they'd get the type propagated out also.
3486
3487 def set_type(fk: ForeignKey) -> None:
3488 if fk.parent.type._isnull:
3489 fk.parent.type = column.type
3490
3491 self.parent._setup_on_memoized_fks(set_type)
3492
3493 self.column = column # type: ignore
3494
3495 @util.ro_memoized_property
3496 def column(self) -> Column[Any]:

Callers 2

_set_remote_tableMethod · 0.95
_set_tableMethod · 0.95

Calls 1

Tested by

no test coverage detected