Opened 5 years ago

Closed 5 years ago

#18334 closed Bug (fixed)

BaseDatabaseOperations._supports_stddev prevents enabling supports_stddev

Reported by: Michael Manfre Owned by: Claude Paroz
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

Description

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 Michael Manfre 5 years ago.
18334-2.diff (2.2 KB) - added by Claude Paroz 5 years ago.
Test included

Download all attachments as: .zip

Change History (9)

Changed 5 years ago by Michael Manfre

Attachment: django-ticket18334.diff added

comment:1 Changed 5 years ago by Michael Manfre

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

comment:2 Changed 5 years ago by Claude Paroz

Needs tests: set
Triage Stage: UnreviewedAccepted

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

comment:3 Changed 5 years ago by Michael 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 5 years ago by Claude Paroz

Owner: changed from nobody to Claude Paroz

Changed 5 years ago by Claude Paroz

Attachment: 18334-2.diff added

Test included

comment:5 Changed 5 years ago by Claude Paroz

Needs tests: unset

Just a quick check before commit?

comment:6 Changed 5 years ago by Anssi Kääriäinen

Triage Stage: AcceptedReady 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 5 years ago by Claude Paroz <claude@…>

Resolution: fixed
Status: newclosed

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
review.

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