[Django] #28393: Make debugging of invalid values assignments to model fields easier

6 views
Skip to first unread message

Django

unread,
Jul 13, 2017, 8:02:17 AM7/13/17
to django-...@googlegroups.com
#28393: Make debugging of invalid values assignments to model fields easier
-------------------------------------+-------------------------------------
Reporter: Diederik | Owner: nobody
van der Boor |
Type: | Status: new
Uncategorized |
Component: Database | Version: 1.11
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
When a large model is updated and saved with invalid values,
Django produces a traceback deep within the ORM, with no clue
which field assignment caused the error.

Developers are faced with:

"TypeError: int() argument must be a string, a bytes-like object or a
number, not 'tuple'"

This change (PR included) displays the field name which makes spotting
errors a lot easier.

--
Ticket URL: <https://code.djangoproject.com/ticket/28393>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 13, 2017, 8:08:29 AM7/13/17
to django-...@googlegroups.com
#28393: Make debugging of invalid values assignments to model fields easier
-------------------------------------+-------------------------------------
Reporter: Diederik van der | Owner: nobody
Boor |
Type: Uncategorized | Status: new
Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Diederik van der Boor:

Old description:

> When a large model is updated and saved with invalid values,
> Django produces a traceback deep within the ORM, with no clue
> which field assignment caused the error.
>
> Developers are faced with:
>
> "TypeError: int() argument must be a string, a bytes-like object or a
> number, not 'tuple'"
>
> This change (PR included) displays the field name which makes spotting
> errors a lot easier.

New description:

When a large model is updated and saved with invalid values,
Django produces a traceback deep within the ORM, with no clue
which field assignment caused the error.

Developers are faced with:

"TypeError: int() argument must be a string, a bytes-like object or a
number, not 'tuple'"

This change (PR included) displays the field name which makes spotting
errors a lot easier.

Pull request: https://github.com/django/django/pull/8760

--

--
Ticket URL: <https://code.djangoproject.com/ticket/28393#comment:1>

Django

unread,
Jul 13, 2017, 2:14:56 PM7/13/17
to django-...@googlegroups.com
#28393: Add a helpful exception for invalid AutoField/IntegerField values

-------------------------------------+-------------------------------------
Reporter: Diederik van der | Owner: nobody
Boor |
Type: | Status: new
Cleanup/optimization |

Component: Database layer | Version: 1.11
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* needs_better_patch: 0 => 1
* type: Uncategorized => Cleanup/optimization
* easy: 1 => 0
* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/28393#comment:2>

Django

unread,
Aug 2, 2019, 4:58:39 PM8/2/19
to django-...@googlegroups.com
#28393: Add a helpful exception for invalid values passed to
AutoField/FloatField/IntegerField.
-------------------------------------+-------------------------------------
Reporter: Diederik van der | Owner: Nick Pope
Boor |
Type: | Status: assigned
Cleanup/optimization |
Component: Database layer | Version: master

(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Nick Pope):

* status: new => assigned
* needs_better_patch: 1 => 0
* version: 1.11 => master
* owner: nobody => Nick Pope


Old description:

> When a large model is updated and saved with invalid values,
> Django produces a traceback deep within the ORM, with no clue
> which field assignment caused the error.
>
> Developers are faced with:
>
> "TypeError: int() argument must be a string, a bytes-like object or a
> number, not 'tuple'"
>
> This change (PR included) displays the field name which makes spotting
> errors a lot easier.
>

> Pull request: https://github.com/django/django/pull/8760

New description:

When a large model is updated and saved with invalid values,
Django produces a traceback deep within the ORM, with no clue
which field assignment caused the error.

Developers are faced with:

"TypeError: int() argument must be a string, a bytes-like object or a
number, not 'tuple'"

This change displays the field name which makes spotting errors a lot
easier.

--

Comment:

New [https://github.com/django/django/pull/11622 PR].

--
Ticket URL: <https://code.djangoproject.com/ticket/28393#comment:3>

Django

unread,
Aug 5, 2019, 3:07:22 AM8/5/19
to django-...@googlegroups.com
#28393: Add a helpful exception for invalid values passed to
AutoField/FloatField/IntegerField.
-------------------------------------+-------------------------------------
Reporter: Diederik van der | Owner: Nick Pope
Boor |
Type: | Status: closed

Cleanup/optimization |
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"25f21bd2376603c8e233a0a0e5a726a0fdfdd33e" 25f21bd2]:
{{{
#!CommitTicketReference repository=""
revision="25f21bd2376603c8e233a0a0e5a726a0fdfdd33e"
Fixed #28393 -- Added helpful error messages for invalid
AutoField/FloatField/IntegerField values.

Co-authored-by: Diederik van der Boor <vdb...@edoburu.nl>
Co-authored-by: Nick Pope <nick...@flightdataservices.com>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28393#comment:4>

Reply all
Reply to author
Forward
0 new messages