Start with the attached script, using a new, blank database since it drops the tables, and work backwards towards the identical situation as your failing code to identify the element causing the failure. My guess would be your primary key column is not actually SERIAL and is instead INTEGER.
Several things I'd note:
1. Declarative is much easier to use than direct usage of mapper(). The SQLA documentation standardizes on declarative as the usual method of setting up mappers.
2. Using "0" as a primary key value is in general a bad idea, SERIAL starts from 1 and has the advantage over "0" that it doesn't evaluate as "false" in many situations.
3. You should probably be using add() in the general case; merge() is a special purpose method for merging incoming data on top of existing data, performs more poorly and has more complex operation.
4. Not sure what the rationale for autoflush=False is. In general if you do things the way the tutorial at http://www.sqlalchemy.org/docs/orm/tutorial.html lays them out, you'll be in pretty good shape. SQLAlchemy certainly has options to make it work in many ways, but if you're just starting out, it's best to stick with how the documentation recommends until you're accustomed to how things work and can tweak things for special cases.