Make loader strategy error message more verbose#12401
Conversation
80a6ff4 to
b15a462
Compare
Fixes: sqlalchemy#12398 this commit makes the error message on conflicting loader strategies more verbose to help with debugging
b15a462 to
41ebcaf
Compare
There was a problem hiding this comment.
ok this doesn't seem to add much value, since the two sides are the same.
@zzzeek do we have also a way of getting what option is used in each part of the path?
There was a problem hiding this comment.
I thought bringing in _LoadElement.strategy might add more value to this, but I realised that it is also equal in a lot of cases.
There was a problem hiding this comment.
im not really sure, I haven't looked at this code in a long time. I do know it's vastly simpler code than it was in 1.4 and earlier
|
@zzzeek do you think we can find that information to use in the exception or it's not easily available? |
Signed-off-by: Jan Vollmer <jan@vllmr.dev>
Signed-off-by: Jan Vollmer <jan@vllmr.dev>
|
I have re-iterated on this PR and found a way to create a verbose representation of the LoadElement. My solution involves more than simply accessing attributes. Therefore, I placed the logic in the |

Fixes: #12398
This PR makes the error message on conflicting loader strategies more verbose to help with debugging
Description
I changed the omitted error messages and the tests covering it.
Checklist
This pull request is:
must include a complete example of the issue. one line code fixes without an
issue and demonstration will not be accepted.
Fixes: #<issue number>in the commit messageinclude a complete example of how the feature would look.
Fixes: #<issue number>in the commit messageHave a nice day!