| 1115 | ) -> Optional[ExternallyTraversible]: ... |
| 1116 | |
| 1117 | def _corresponding_column( |
| 1118 | self, col, require_embedded, _seen=util.EMPTY_SET |
| 1119 | ): |
| 1120 | newcol = self.selectable.corresponding_column( |
| 1121 | col, require_embedded=require_embedded |
| 1122 | ) |
| 1123 | if newcol is None and col in self.equivalents and col not in _seen: |
| 1124 | for equiv in self.equivalents[col]: |
| 1125 | newcol = self._corresponding_column( |
| 1126 | equiv, |
| 1127 | require_embedded=require_embedded, |
| 1128 | _seen=_seen.union([col]), |
| 1129 | ) |
| 1130 | if newcol is not None: |
| 1131 | return newcol |
| 1132 | |
| 1133 | if ( |
| 1134 | self.adapt_on_names |
| 1135 | and newcol is None |
| 1136 | and isinstance(col, NamedColumn) |
| 1137 | ): |
| 1138 | newcol = self.selectable.exported_columns.get(col.name) |
| 1139 | return newcol |
| 1140 | |
| 1141 | @util.preload_module("sqlalchemy.sql.functions") |
| 1142 | def replace( |