Describe the use case
I just received the following error of in my project and have an improvement request similar to #10668
:
sqlalchemy.exc.InvalidRequestError: Loader strategies for ORM Path[Mapper[Cable(cable)] -> Cable.cablesides -> Mapper[CadCableSide(cad_cable_side)]] conflict
While this tells me that there is a conflict and that my temporary replacement in the query causes a conflict, I am left alone to find out what exactly is in conflict with my replacement. This can be especially bothersome in a project with many models with many relationships with different loading strategies.
Therefore I suggest to add the existing loading strategy to the error message.
Relevant code:
|
f"Loader strategies for {replacement.path} conflict" |
Databases / Backends / Drivers targeted
All
Example Use
New error message could be something like this:
f"Loader strategy replacement {replacement.path} is in conflict with existing strategy {existing.path}"
I would gladly create a PR for it myself like last time.
Additional context
No response
Describe the use case
I just received the following error of in my project and have an improvement request similar to #10668
:
While this tells me that there is a conflict and that my temporary replacement in the query causes a conflict, I am left alone to find out what exactly is in conflict with my replacement. This can be especially bothersome in a project with many models with many relationships with different loading strategies.
Therefore I suggest to add the existing loading strategy to the error message.
Relevant code:
sqlalchemy/lib/sqlalchemy/orm/strategy_options.py
Line 1874 in d9b4d8f
Databases / Backends / Drivers targeted
All
Example Use
New error message could be something like this:
f"Loader strategy replacement {replacement.path} is in conflict with existing strategy {existing.path}"I would gladly create a PR for it myself like last time.
Additional context
No response