def test_relationship_serialization(es): relationship = Relationship(es['sessions']['id'], es['log']['session_id']) dictionary = { 'parent_entity_id': 'sessions', 'parent_variable_id': 'id', 'child_entity_id': 'log', 'child_variable_id': 'session_id', } assert relationship.to_dictionary() == dictionary assert Relationship.from_dictionary(dictionary, es) == relationship
def test_relationship_serialization(es): relationship = Relationship(es, 'sessions', 'id', 'log', 'session_id') dictionary = { 'parent_dataframe_name': 'sessions', 'parent_column_name': 'id', 'child_dataframe_name': 'log', 'child_column_name': 'session_id', } assert relationship.to_dictionary() == dictionary assert Relationship.from_dictionary(dictionary, es) == relationship
def test_relationship_serialization(es): relationship = Relationship(es, "sessions", "id", "log", "session_id") dictionary = { "parent_dataframe_name": "sessions", "parent_column_name": "id", "child_dataframe_name": "log", "child_column_name": "session_id", } assert relationship.to_dictionary() == dictionary assert Relationship.from_dictionary(dictionary, es) == relationship