On Thu, Oct 26, 2017 at 6:32 AM,  <[email protected]> wrote:
> Hi,
>
> I am curious about this warning:
>
> /…/lib/python3.5/site-packages/sqlalchemy/orm/persistence.py:964: SAWarning:
> DELETE statement on table '…' expected to delete 1 row(s); 0 were matched.
> Please set confirm_deleted_rows=False within the mapper configuration to
> prevent this warning.
>   (table.description, expected, rows_matched)

it means the ORM emitted a statement like:

DELETE FROM your_table WHERE primary_key=<X>

and then there was no row with "X".   This is not supposed to happen,
and is usually an indicator that ORM-level code is causing a delete of
the same row more than once.   Such as, emitting a DELETE statement
and then also saying session.delete(some_object).    You'd want to
understand why this is happening and then if you identify it as an
unavoidable situation, set up that flag.



>
> I found this Stackoverflow thread but it didn't give away mach information.
>
> The warning appears seemingly random, and I'm curious about its details.
> Could somebody please shed light on it? I'm hesitant about silencing a
> warning without understanding its cause(s).
>
> Thank you!
> Jens
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to