cognee/cognee/modules/graph/utils/copy_edge.py
2025-11-20 15:15:43 +01:00

7 lines
201 B
Python

def copy_edge(obj, overrides):
cls = obj.__class__
data = {c.name: getattr(obj, c.name) for c in cls.__table__.columns if not c.primary_key}
data.update(overrides)
return cls(**data)