- changed status to resolved
metadata doesn't serialize naming convention
Issue #3362
resolved
from sqlalchemy import Table, Column, MetaData, Integer
import pickle
m = MetaData(naming_convention={"pk": "%(table_name)s_pk"})
t = Table('t', m, Column('id', Integer, primary_key=True))
m2 = pickle.loads(pickle.dumps(m))
t2a = Table('t2', m, Column('id', Integer, primary_key=True))
t2b = Table('t2', m2, Column('id', Integer, primary_key=True))
assert t2a.primary_key.name == t2b.primary_key.name
Comments (2)
-
reporter -
reporter - Fixed issue where a :class:
.MetaData
object that used a naming convention would not properly work with pickle. The attribute was skipped leading to inconsistencies and failures if the unpickled :class:.MetaData
object were used to base additional tables from. fixes#3362
(cherry picked from commit 55c26710a1f6d6c6f87a9752035bc160f93b38d0)
→ <<cset e7cf56828486>>
- Fixed issue where a :class:
- Log in to comment
.MetaData
object that used a naming convention would not properly work with pickle. The attribute was skipped leading to inconsistencies and failures if the unpickled :class:.MetaData
object were used to base additional tables from. fixes#3362→ <<cset 55c26710a1f6>>