Opened 4 years ago

Closed 4 years ago

#18334 closed Bug (fixed)

BaseDatabaseOperations._supports_stddev prevents enabling supports_stddev

Reported by: manfre Owned by: claudep
Component: Database layer (models, ORM) Version: master
Severity: Normal Keywords: stddev
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


BaseDatabaseOperations._supports_stddev() doesn't return a value, which disables supports_stddev for all backends, except sqlite3 (overrides it the function).

Attachments (2)

django-ticket18334.diff (600 bytes) - added by manfre 4 years ago.
18334-2.diff (2.2 KB) - added by claudep 4 years ago.
Test included

Download all attachments as: .zip

Change History (9)

Changed 4 years ago by manfre

comment:1 Changed 4 years ago by manfre

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I haven't checked previous versions to see when this broke.

comment:2 Changed 4 years ago by claudep

  • Needs tests set
  • Triage Stage changed from Unreviewed to Accepted

It would be nice to have a test for this, at least for PostgreSQL.

comment:3 Changed 4 years ago by manfre

Stddev tests already exist in aggregation_regress. They are currently being skipped by postgres and oracle because those backends are incorrectly reporting that supports_stddev = False.

comment:4 Changed 4 years ago by claudep

  • Owner changed from nobody to claudep

Changed 4 years ago by claudep

Test included

comment:5 Changed 4 years ago by claudep

  • Needs tests unset

Just a quick check before commit?

comment:6 Changed 4 years ago by akaariai

  • Triage Stage changed from Accepted to Ready for checkin

Seems like this will fix the issue. I tested the patch on all core backends and no errors spotted, and I added an assert(False) to the stddev test and got a failure on PostgreSQL. So, LGTM.

I spotted that the SQLite test could be simplified to select stddev(1) instead of the create table - select - drop table thing. But, not this ticket's problem...

comment:7 Changed 4 years ago by Claude Paroz <claude@…>

  • Resolution set to fixed
  • Status changed from new to closed

In [7549de841c6e0d18822af047763f5e3211539be8]:

Fixed #18334 -- Fixed detection of supports_stddev backend feature.

Thanks to Michael Manfre for the report and Anssi Kääriäinen for the

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