So I guess that symbols starting with underscore ('_') are treated
differently in Python when it comes to be exporting/importing? Sorry
to be such a newb but this is the only conclusion I can (rationally!)
come to.
Traceback (most recent call last):
File chimera_driver.py, line 42, in module
OK. This appears to be the source of the problem. You may recall a
couple of weeks ago that I was looking for information on how to
surface comments from the database metadata into the sqlalchemy model
and into docstrings in mapped classes? I took your suggestion and
modified it slightly. When I
what does compile_mappers() say?can you call this mapper, and at the
same time all mappers within the entire application have been called ?
phrrn...@googlemail.com wrote:
I copied the list of import statements from the module file
(deshaw.dbo.chimera) to the driver file. The driver file
I don't see any output from it at all. I am calling it after importing
everything but before making any queries. The mapper registry looks
unsurprising (albeit based on a guess of what it does)
pjjH
from sqlalchemy.orm import compile_mappers
s = MySession(bind=e)
print compile_mappers()
q =
Not sure if this is relevant? As you might have guessed from my posts,
I am at the 'waving a dead chicken' around stage of debugging.
pjjH
(Pdb) import pickle
(Pdb) print pickle.dumps(m)
*** PicklingError: Can't pickle class
'sqlalchemy.orm.properties.Comparator': it's not found as
phrrn...@googlemail.com wrote:
# class AttachNotesAsDocstring(interfaces.InstrumentationManager):
# def instrument_attribute(self, class_, key, attr):
# if isinstance(attr.property, properties.ColumnProperty):
# if hasattr(attr.property.columns[0], 'info'):
#
Yes, the erroneous behavior goes away when this code is commented out.
No, an empty instrumentation manager *does not cause* the error. Note
that I had a sqlalchemy Table object called 'attributes' in my model.
I have changed the code so that I do not import 'attributes' from
sqlalchemy.orm but
any chance of producing a *small* test case for this
phrrn...@googlemail.com wrote:
Yes, the erroneous behavior goes away when this code is commented out.
No, an empty instrumentation manager *does not cause* the error. Note
that I had a sqlalchemy Table object called 'attributes' in my
Sure. I am going to leave it until Monday or Tuesday as I hope by that
time to return to my work on getting the Sybase driver to pass the
test cases. I was away on vacation until last Monday and found it
difficult to get back into coding until of course I was confronted by
this issue!
Thanks
make sure everything that's needed is imported, and that you arent
suppressing any exceptions which occur when the mappers first compile
themselves. try calling compile_mappers() to force the issue.
On Apr 2, 8:19 pm, phrrn...@googlemail.com phrrn...@googlemail.com
wrote:
This code works when
10 matches
Mail list logo