FlushError even if no SQL statement will be emitted and allow_partial_pks is True

Issue #2390 resolved
Former user created an issue

Comments (4)

  1. Former user Account Deleted

    I know you were leaning toward only raising if you have determined there is something to update. The alternative in my mind is only raise if ... and not mapper.allow_partial_pks:

                                    if value is None and not mapper.allow_partial_pks:
                                        raise sa_exc.FlushError(
                                                    "Can't update table "
                                                    "using NULL for primary "
                                                    "key value")
    
  2. Mike Bayer repo owner

    1f057987da6ee5ca6da94384a0603e4fee13dff8 only raises if there's something to update. actually supporting "UPDATE...WHERE .. x IS NULL", I'm not too keen on that. let me know if this solves your issue.

    Also I'm ready to break up _save_obj() and _delete_obj() into smaller methods as their length is starting to become embarrassing.

  3. Log in to comment