i can look later, if i forget after a day or so please post this to github discussions and/or issues where i will notice it better
On Thu, Jul 15, 2021, at 7:44 AM, Lele Gaifax wrote: > Hi, > > while upgrading one of my apps to SA 1.4, paying attention toward 2.0 > compatibility, I found one single issue that I was not able to figure out > whether I'm doing something wrong or missed something in the excellent > migration guide. > > All tests pass, but executing them with SQLALCHEMY_WARN_20 I noticed the > following message: > > RemovedIn20Warning: Using strings to indicate column or relationship paths > in loader options is deprecated and will be removed in SQLAlchemy 2.0... > > It was not so simple to isolate the culprit code, but I eventually found the > cause: here and there my app uses the load_only() option to load a subset of > the columns of related entities, and that's what upsets the compatibily check. > > I'm attaching below a simple script that exhibits the problem (when executed > with SQLALCHEMY_WARN_20=1). > > The documentation[1] shows a very similar usage, so I'm not sure where's the > problem. Maybe using joinedload(X.y).load_only(a, b), a and b cannot be column > names under 2.0, but should be Y.a and Y.b instead? > > Thanks a lot for any hint, > ciao, lele. > > [1] > https://docs.sqlalchemy.org/en/14/orm/query.html#sqlalchemy.orm.Load.load_only > > -- > SQLAlchemy - > The Python SQL Toolkit and Object Relational Mapper > > http://www.sqlalchemy.org/ > > To post example code, please provide an MCVE: Minimal, Complete, and > Verifiable Example. See http://stackoverflow.com/help/mcve for a full > description. > --- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sqlalchemy+unsubscr...@googlegroups.com > <mailto:sqlalchemy%2bunsubscr...@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sqlalchemy/87y2a7ls26.fsf%40metapensiero.it. > > > -- > nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri > real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. > l...@metapensiero.it | -- Fortunato Depero, 1929. > > -- > SQLAlchemy - > The Python SQL Toolkit and Object Relational Mapper > > http://www.sqlalchemy.org/ > > To post example code, please provide an MCVE: Minimal, Complete, and > Verifiable Example. See http://stackoverflow.com/help/mcve for a full > description. > --- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sqlalchemy+unsubscr...@googlegroups.com > <mailto:sqlalchemy%2bunsubscr...@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sqlalchemy/87y2a7ls26.fsf%40metapensiero.it. > > > *Attachments:* > * test.py -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/2d075c9e-b1bc-4fa4-9639-c5e110c3004f%40www.fastmail.com.