#22205 closed Uncategorized (wontfix)

Feature request: Warn about aggregating over possibly incompatible types

Reported by: nbtrap@… Owned by: nobody
Component: Database layer (models, ORM) Version: 1.6
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

We recently pushed to our production environment a feature that involved
summing (with django.db.models.Sum) over CharField entries containing
numeric text. It ended up not working correctly since the postgresql
SUM function can't handle textual arguments, whereas sqlite's apparently
can.

A nice feature that might have saved us the trouble would be to emit
warnings when running an aggregation function with types that don't work
with all of the db backends.

Cf. https://groups.google.com/forum/#!topic/django-developers/z1LXMNdXEFM

Change History (1)

comment:1 Changed 12 months ago by manfre

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

You should use the same backend for production, staging, and unit tests. Doing this is a good practice and negates the need for this feature. Marking as wontfix because this feature only benefits a bad practice.

Note: See TracTickets for help on using tickets.
Back to Top