Re: [sqlalchemy] Change in before_flush (maybe from 1.3 to 1.4?)

2021-09-09 Thread 'Jonathan Vanasco' via sqlalchemy
What version of 1.4 are you using?  It is before 1.4.7? If so, please 
update to the latest (1.4.23 is current)

There was a regression in some early 1.4s that affected 
flush/commit/transaction in some situations. That was solved in 1.4.7.


On Thursday, September 9, 2021 at 8:52:59 AM UTC-4 Mike Bayer wrote:

>
>
> On Sun, Sep 5, 2021, at 6:41 PM, and...@acooke.org wrote:
>
>
> I'm having a hard time understanding some of my own code, which no longer 
> works.  The only way I can see it having worked in the past is if 
> auto-flushing did not call before_flush, but commit did?  Is that possible?
>
>
> autoflushing has always called before_flush.
>
>
> Somehow I was managing to create instances (in Python) and populate them 
> with auto-generated key values from the database, but then filter out some 
> objects (those with certain attributes null) and never commit them to the 
> database (in before_flush).
>
> I realise this is a somewhat confusing question, sorry, and I can probably 
> fix my code anyway.  I am just looking for some peace of mind in 
> understanding how on earth it ever worked.
>
> Thanks,
> Andrew
>
>
> -- 
> 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+...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/6a11bc86-54d3-4993-8746-ec865b3003a9n%40googlegroups.com
>  
> 
> .
>
>
>

-- 
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/0b13b266-9108-4c4b-87ea-18986fcbe140n%40googlegroups.com.


Re: [sqlalchemy] Change in before_flush (maybe from 1.3 to 1.4?)

2021-09-09 Thread Mike Bayer


On Sun, Sep 5, 2021, at 6:41 PM, and...@acooke.org wrote:
> 
> I'm having a hard time understanding some of my own code, which no longer 
> works.  The only way I can see it having worked in the past is if 
> auto-flushing did not call before_flush, but commit did?  Is that possible?

autoflushing has always called before_flush.

> 
> Somehow I was managing to create instances (in Python) and populate them with 
> auto-generated key values from the database, but then filter out some objects 
> (those with certain attributes null) and never commit them to the database 
> (in before_flush).
> 
> I realise this is a somewhat confusing question, sorry, and I can probably 
> fix my code anyway.  I am just looking for some peace of mind in 
> understanding how on earth it ever worked.
> 
> Thanks,
> Andrew
> 
> 
> -- 
> 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/6a11bc86-54d3-4993-8746-ec865b3003a9n%40googlegroups.com
>  
> .

-- 
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/3d1e9516-403f-42d2-99ae-6c9932506538%40www.fastmail.com.


[sqlalchemy] Change in before_flush (maybe from 1.3 to 1.4?)

2021-09-05 Thread and...@acooke.org

I'm having a hard time understanding some of my own code, which no longer 
works.  The only way I can see it having worked in the past is if 
auto-flushing did not call before_flush, but commit did?  Is that possible?

Somehow I was managing to create instances (in Python) and populate them 
with auto-generated key values from the database, but then filter out some 
objects (those with certain attributes null) and never commit them to the 
database (in before_flush).

I realise this is a somewhat confusing question, sorry, and I can probably 
fix my code anyway.  I am just looking for some peace of mind in 
understanding how on earth it ever worked.

Thanks,
Andrew

-- 
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/6a11bc86-54d3-4993-8746-ec865b3003a9n%40googlegroups.com.