Every test fails, and honestly I don't have a clue of why this is
happening ...
Traceback (most recent call last):
File "/Users/ngw/euro/python/sqlmask/test/test_sqlmask.py", line 35,
in testSimpleLayoutGeneration
t = reflect.mapTable (self.engine, 'test')
File "/Users/ngw/euro/python/sqlmask/src/reflect.py", line 9, in
mapTable
table = Table (table_name, engine, autoload = True)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/
lib/python2.4/site-packages/SQLAlchemy-0.91alpha-py2.4.egg/
sqlalchemy/schema.py",
line 90, in __call__
engine.reflecttable(table)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/
lib/python2.4/site-packages/SQLAlchemy-0.91alpha-py2.4.egg/
sqlalchemy/databases/postgres.py",
line 204, in reflecttable
ischema.reflecttable(self, table, ischema_names)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/
lib/python2.4/site-packages/SQLAlchemy-0.91alpha-py2.4.egg/
sqlalchemy/databases/information_schema.py",
line 45, in reflecttable
columns = gen_columns.toengine(engine)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/
lib/python2.4/site-packages/SQLAlchemy-0.91alpha-py2.4.egg/
sqlalchemy/schema.py",
line 200, in toengine
return Table(self.name, engine, schema=schema, *args)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/
lib/python2.4/site-packages/SQLAlchemy-0.91alpha-py2.4.egg/
sqlalchemy/schema.py",
line 73, in __call__
key = _get_table_key(engine, name, schema)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/
lib/python2.4/site-packages/SQLAlchemy-0.91alpha-py2.4.egg/
sqlalchemy/schema.py",
line 56, in _get_table_key
if schema is not None and schema ==
engine.get_default_schema_name():
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/
lib/python2.4/site-packages/SQLAlchemy-0.91alpha-py2.4.egg/
sqlalchemy/databases/postgres.py",
line 157, in get_default_schema_name
self._default_schema_name = text("select current_schema()",
self).scalar()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/
lib/python2.4/site-packages/SQLAlchemy-0.91alpha-py2.4.egg/
sqlalchemy/sql.py",
line 398, in scalar
return self.execute(*multiparams, **params).fetchone()[0]
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/
lib/python2.4/site-packages/SQLAlchemy-0.91alpha-py2.4.egg/
sqlalchemy/sql.py",
line 392, in execute
return c.execute(*multiparams, **params)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/
lib/python2.4/site-packages/SQLAlchemy-0.91alpha-py2.4.egg/
sqlalchemy/sql.py",
line 290, in execute
return self.engine.execute_compiled(self, params)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/
lib/python2.4/site-packages/SQLAlchemy-0.91alpha-py2.4.egg/
sqlalchemy/engine.py",
line 502, in execute_compiled
connection = self.connection()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/
lib/python2.4/site-packages/SQLAlchemy-0.91alpha-py2.4.egg/
sqlalchemy/engine.py",
line 359, in connection
return self._pool.connect()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/
lib/python2.4/site-packages/SQLAlchemy-0.91alpha-py2.4.egg/
sqlalchemy/pool.py",
line 84, in connect
agent = ConnectionFairy(self)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/
lib/python2.4/site-packages/SQLAlchemy-0.91alpha-py2.4.egg/
sqlalchemy/pool.py",
line 115, in __init__
self.connection = pool.get()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/
lib/python2.4/site-packages/SQLAlchemy-0.91alpha-py2.4.egg/
sqlalchemy/pool.py",
line 97, in get
return self.do_get()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/
lib/python2.4/site-packages/SQLAlchemy-0.91alpha-py2.4.egg/
sqlalchemy/pool.py",
line 182, in do_get
return self._creator()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.4/
lib/python2.4/site-packages/SQLAlchemy-0.91alpha-py2.4.egg/
sqlalchemy/pool.py",
line 236, in <lambda>
pool = self.poolclass(lambda: self.module.connect(*args,
**params), **self.params)
TypeError: an integer is required
This is how i reflect my tables:
from sqlalchemy import *
class Mapper (object):
pass
def mapTable (engine, table_name):
table = Table (table_name, engine, autoload = True)
return table
def getMapper (table):
return mapper (Mapper, table)
def getRecord (table, **kwds):
tablemapper = getMapper (table)
record = tablemapper.select_by (**kwds)
return record [0]
The engine is a normal engine that uses 'postgresql' as backend.
Every test fails with this error, and with psycopg1 everything was
working fine.
Any idea ?
ngw
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through
log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD
SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
Sqlalchemy-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users