#24164: Oracle GIS geoapp extent test failure
---------------------------+-------------------------------------
     Reporter:  timgraham  |                    Owner:  timgraham
         Type:  Bug        |                   Status:  assigned
    Component:  GIS        |                  Version:  1.8alpha1
     Severity:  Normal     |               Resolution:
     Keywords:  oracle     |             Triage Stage:  Accepted
    Has patch:  0          |      Needs documentation:  0
  Needs tests:  0          |  Patch needs improvement:  0
Easy pickings:  0          |                    UI/UX:  0
---------------------------+-------------------------------------

Comment (by timgraham):

 WIP:
 
https://github.com/timgraham/django/compare/django:master...timgraham:24164?expand=1

 So far I got rid of the inner `SDO_UTIL.TO_WKTGEOMETRY` calls so the query
 is now:
 {{{#!sql
 SELECT SDO_AGGR_MBR("__COL1") FROM (
     SELECT * FROM (
         SELECT "_SUB".*, ROWNUM AS "_RN" FROM (
             SELECT "GEOAPP_CITY"."ID", "GEOAPP_CITY"."NAME",
                 "GEOAPP_CITY"."POINT", "GEOAPP_CITY"."POINT" AS "__COL1"
             FROM "GEOAPP_CITY"
         ) "_SUB" WHERE ROWNUM <= 3
     ) WHERE "_RN" > 0
 ) subquery
 }}}
 but there's a Python error:
 {{{
 ======================================================================
 ERROR: test_extent_with_limit
 (django.contrib.gis.tests.geoapp.tests.GeoQuerySetTest)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/home/tim/code/django/django/test/testcases.py", line 1005, in
 skip_wrapper
     return test_func(*args, **kwargs)
   File "/home/tim/code/django/django/contrib/gis/tests/geoapp/tests.py",
 line 519, in test_extent_with_limit
     extent2 =
 City.objects.all()[:3].aggregate(Extent('point'))['point__extent']
   File "/home/tim/code/django/django/db/models/query.py", line 306, in
 aggregate
     return query.get_aggregation(self.db, kwargs.keys())
   File "/home/tim/code/django/django/db/models/sql/query.py", line 428, in
 get_aggregation
     result = compiler.apply_converters(result, converters)
   File "/home/tim/code/django/django/db/models/sql/compiler.py", line 777,
 in apply_converters
     value = converter(value, self.connection, self.query.context)
   File "/home/tim/code/django/django/contrib/gis/db/models/aggregates.py",
 line 48, in convert_value
     return connection.ops.convert_extent(value,
 context.get('transformed_srid'))
   File
 "/home/tim/code/django/django/contrib/gis/db/backends/oracle/operations.py",
 line 142, in convert_extent
     ext_geom = Geometry(clob.read(), srid)
 AttributeError: 'cx_Oracle.OBJECT' object has no attribute 'read'
 }}}
 Is the first line of the correct query supposed to be `SELECT
 SDO_AGGR_MBR(SDO_AGGR_MBR("__COL1"))` instead?

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.02b3b99b5baef14c80ede24e5cb49adf%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to