Hi all together!

As this is my first post a short introducion: I am an geo-engineer
working on geoinformatics, spatial databases and spatial data
infrastructure. For this I am using sqlalchemy and geoalchemy for most
database-projects. At the moment i run into an error after upgrading
to 0.7.4.

I write a library with some classes that has to bundle function for
different applications accessing data on a PostgreSQL-9.x Server.
sqlalchemy is installed and maintained by easy_install not by
packetmanagement. After upgrading to 0.7.4 the following error occurs:

Python 2.6.5 (r265:79063, May  6 2011, 17:25:59)
[GCC 4.5.0 20100604 [gcc-4_5-branch revision 160292]] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlalchemy
>>> sqlalchemy.__version__
'0.7.4'
>>> import endblib
/usr/local/lib64/python2.6/site-packages/endblib/model/auth.py:42:
SADeprecationWarning: useexisting is deprecated.  Use extend_existing.
  schema=schemata['pub'], useexisting=False
/usr/local/lib64/python2.6/site-packages/endblib/model/auth.py:52:
SADeprecationWarning: useexisting is deprecated.  Use extend_existing.
  schema=schemata['pub'],  useexisting=False
/usr/local/lib/python2.6/site-packages/SQLAlchemy-0.7.4-py2.6-linux-
x86_64.egg/sqlalchemy/ext/declarative.py:1172: SADeprecationWarning:
useexisting is deprecated.  Use extend_existing.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib64/python2.6/site-packages/endblib/__init__.py",
line 24, in <module>
    import model.endb as endb
  File "/usr/local/lib64/python2.6/site-packages/endblib/model/
__init__.py", line 4, in <module>
    import endb
  File "/usr/local/lib64/python2.6/site-packages/endblib/model/
endb.py", line 479, in <module>
    class Facility(EnDBBaseMixIn,  Producer):
  File "build/bdist.linux-x86_64/egg/sqlalchemy/ext/declarative.py",
line 1273, in __init__
  File "build/bdist.linux-x86_64/egg/sqlalchemy/ext/declarative.py",
line 1266, in _as_declarative
  File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/__init__.py", line
1114, in mapper

  File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/mapper.py", line
201, in __init__
  File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/mapper.py", line
824, in _configure_properties
  File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/mapper.py", line
1481, in _should_exclude
  File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/mapper.py", line
1458, in _is_userland_descriptor
TypeError: Error when calling the metaclass bases
    issubclass() arg 1 must be a class

The import works fine in version 0.6.6.

What (I think ;) ) it does here: It tries to map the class Facility
which consists of a MixIn-class to provide some special methods and a
parent class which provides some fields and general methods. Some
tests are done and one of it fails. To hunt this error down I searched
the code and found this in the function _is_userland_descriptor:

version 0.7.4:

    def _is_userland_descriptor(self,
obj):
        return not isinstance(obj,
                    (MapperProperty, attributes.QueryableAttribute))
and \
                    hasattr(obj, '__get__') and not \
                     isinstance(obj.__get__(None, obj),
                                    attributes.QueryableAttribute)

version 0.6.6:

    def _is_userland_descriptor(self, obj):
        return not
isinstance(obj,
                    (MapperProperty,
attributes.InstrumentedAttribute)) and \
                    hasattr(obj, '__get__')

So what causes the error? If i have some time today i will try to
build a compressed example to demonstrate te effect. Can it be a
solution to set the two functions in a try/except-block?
Thank you in advance.

Uwe Seher

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to