- marked as enhancement
- changed milestone to 0.6.7
Usability: FlushError: ambiguous/broken error message
"FlushError: Attempting to flush an item of type X on collection Y, whose mapper does not inherit from that of Z."
It is not clear whether "whose mapper" means the mapper of collection Y or the item of type X (or type X). Similarly, "that" is ambiguous.
It should actually look like this (assuming I understood the error correctly now after some googling):
"FlushError: Attempting to flush an item of type X on collection Y, while the mapper of X does not inherit from the mapper of Z."
Comments (8)
-
repo owner -
repo owner correction, its technically possible that X extends Z but the mappers aren't set up that way (this is why these messages can become awkward). Plus there's still an implicit subject in there.
"Attempting to flush an item of type X as a member of collection Y; but the mapper of X does not specify "inherits" from the mapper of Z, where Z is the type of object stored by Y"
-
Account Deleted "that" is ambiguous because it could also mean "whose mapper does not inherit from the collection of Z." or something else. (to someone who doesn't know what the error means at all and has to guess how it is all supposed to be put together - of course we know that this refers to the mapper of Z and not something else)
But your suggestion sounds fine:
"Attempting to flush an item of type X as a member of collection Y; but the mapper of X does not specify "inherits" from the mapper of Z, where Z is the type of object stored by Y"
Even better than my suggestion due to the additional information about Z being usually stored by Y :)
-
Account Deleted Adjusted FlushError message in orm/dependency.py https://bitbucket.org/olduvaihand/sqlalchemy/changeset/3d90360d87fb
-
repo owner - changed status to resolved
the above repo wasn't readable.
Also the proposed message is nightmarishly long. Went with something more succinct. Each sentence has only one primary subject.
33691f6837970adfb6043094ab7e4ef63e44aceb 6c2c105c30ba46c410be6200a8f923c41dc38b70
-
repo owner - removed status
- changed status to open
crap, missed the other message, trying again
-
repo owner - changed status to resolved
-
repo owner - removed milestone
Removing milestone: 0.6.7 (automated comment)
- Log in to comment
I don't think the "that" is ambiguous, it means "the mapper of Z". "A, whose B does not C from that of D" - "that of D" means "the B of D".
"whose" refers to X but I will agree the target on that element is ambiguous.
If we're going to rewrite the sentence, might as well remove as much SQLAlchemy terminology as possible, so I'd propose "Attempting to flush an item of type X as a member of collection Y; but X is not a subclass of Z, the type of object stored by Y". Let me know if you approve.