Error reporting helper for mapper._columntoproperty.
| 4418 | |
| 4419 | |
| 4420 | class _ColumnMapping(Dict["ColumnElement[Any]", "MapperProperty[Any]"]): |
| 4421 | """Error reporting helper for mapper._columntoproperty.""" |
| 4422 | |
| 4423 | __slots__ = ("mapper",) |
| 4424 | |
| 4425 | def __init__(self, mapper): |
| 4426 | # TODO: weakref would be a good idea here |
| 4427 | self.mapper = mapper |
| 4428 | |
| 4429 | def __missing__(self, column): |
| 4430 | prop = self.mapper._props.get(column) |
| 4431 | if prop: |
| 4432 | raise orm_exc.UnmappedColumnError( |
| 4433 | "Column '%s.%s' is not available, due to " |
| 4434 | "conflicting property '%s':%r" |
| 4435 | % (column.table.name, column.name, column.key, prop) |
| 4436 | ) |
| 4437 | raise orm_exc.UnmappedColumnError( |
| 4438 | "No column %s is configured on mapper %s..." |
| 4439 | % (column, self.mapper) |
| 4440 | ) |
no outgoing calls
no test coverage detected