Opened 5 years ago

Closed 5 years ago

#30123 closed Cleanup/optimization (fixed)

Remove support for tuples returned from DatabaseIntrospection.get_field_type().

Reported by: Nick Pope Owned by: Nick Pope
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
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

Following on from #30115, there are two places where DatabaseIntrospection.get_field_type() returns a tuple pair of the string name of the field type and a dictionary of extra parameters for the field type:

  1. For the SQLite backend where a field has a size, e.g. varchar(40).
  2. For the PostGIS backend where we need to handle geography data types.

The SQLite case led to an obscure bug that has been addressed for #30115 by removing it as it turned out that the max_length value was already handled.

This leaves only the PostGIS case which this ticket proposes to replace with an alternative solution, as well as the removal of workarounds in the test suite that handle tuples returned from DatabaseIntrospection.get_field_type().

Change History (5)

comment:1 by Nick Pope, 5 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

PR

Marked as accepted based on comments in original PR from which this is derived.

comment:2 by Tim Graham, 5 years ago

Triage Stage: AcceptedReady for checkin

comment:3 by Tim Graham <timograham@…>, 5 years ago

In 327bbaa:

Refs #30123 -- Changed second arg of DatabaseIntrospection.get_geometry_type() to the row description.

comment:4 by Tim Graham <timograham@…>, 5 years ago

In 8d01edf:

Refs #30123 -- Simplified introspection of geography columns on PostGIS.

comment:5 by Tim Graham <timograham@…>, 5 years ago

Resolution: fixed
Status: assignedclosed

In 0ef99796:

Fixed #30123 -- Removed tuple support in DatabaseIntrospection.get_field_type().

Support for returning tuples was undocumented and error prone.

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