def add_relationship(self, relationship):
    'Add a new relationship between entities in the entityset\n\n        Args:\n            relationship (Relationship) : Instance of new\n                relationship to be added.\n        '
    if (relationship in self.relationships):
        logger.warning('Not adding duplicate relationship: %s', relationship)
        return self
    child_e = relationship.child_entity
    child_v = relationship.child_variable.id
    parent_e = relationship.parent_entity
    parent_v = relationship.parent_variable.id
    if (not isinstance(child_e[child_v], vtypes.Id)):
        child_e.convert_variable_type(variable_id=child_v, new_type=vtypes.Id, convert_data=False)
    if (not isinstance(parent_e[parent_v], vtypes.Index)):
        parent_e.convert_variable_type(variable_id=parent_v, new_type=vtypes.Index, convert_data=False)
    if (isinstance(child_e.df, pd.DataFrame) and (child_e.df.empty and (child_e.df[child_v].dtype == object) and is_numeric_dtype(parent_e.df[parent_v]))):
        child_e.df[child_v] = pd.Series(name=child_v, dtype=np.int64)
    parent_dtype = parent_e.df[parent_v].dtype
    child_dtype = child_e.df[child_v].dtype
    msg = u'Unable to add relationship because {} in {} is Pandas dtype {} and {} in {} is Pandas dtype {}.'
    if (not is_dtype_equal(parent_dtype, child_dtype)):
        raise ValueError(msg.format(parent_v, parent_e.id, parent_dtype, child_v, child_e.id, child_dtype))
    self.relationships.append(relationship)
    self.reset_data_description()
    return self
Add a new relationship between entities in the entityset

Args:
    relationship (Relationship) : Instance of new
        relationship to be added.
def add_relationship(self, relationship):
    'Add a new relationship between entities in the entityset\n\n        Args:\n            relationship (Relationship) : Instance of new\n                relationship to be added.\n        '
    if (relationship in self.relationships):
        logger.warning('Not adding duplicate relationship: %s', relationship)
        return self
    child_e = relationship.child_entity
    child_v = relationship.child_variable.id
    parent_e = relationship.parent_entity
    parent_v = relationship.parent_variable.id
    if (not isinstance(child_e[child_v], vtypes.Id)):
        child_e.convert_variable_type(variable_id=child_v, new_type=vtypes.Id, convert_data=False)
    if (not isinstance(parent_e[parent_v], vtypes.Index)):
        parent_e.convert_variable_type(variable_id=parent_v, new_type=vtypes.Index, convert_data=False)
    if (isinstance(child_e.df, pd.DataFrame) and (child_e.df.empty and (child_e.df[child_v].dtype == object) and is_numeric_dtype(parent_e.df[parent_v]))):
        child_e.df[child_v] = pd.Series(name=child_v, dtype=np.int64)
    parent_dtype = parent_e.df[parent_v].dtype
    child_dtype = child_e.df[child_v].dtype
    msg = u'Unable to add relationship because {} in {} is Pandas dtype {} and {} in {} is Pandas dtype {}.'
    if (not is_dtype_equal(parent_dtype, child_dtype)):
        raise ValueError(msg.format(parent_v, parent_e.id, parent_dtype, child_v, child_e.id, child_dtype))
    self.relationships.append(relationship)
    self.reset_data_description()
    return self