class_docstr: Calculates the values of a set of features for given instance ids.
docstr: Merge ancestor_relationship_columns from parent_df into child_df, adding a prefix to
  each column name specifying the relationship.
  
  Return the updated df and the new relationship column names.
  
  Args:
      child_df (pd.DataFrame): The dataframe to add relationship columns to.
      parent_df (pd.DataFrame): The dataframe to copy relationship columns from.
      ancestor_relationship_columns (list[str]): The names of
          relationship columns in the parent_df to copy into child_df.
      relationship (Relationship): the relationship through which the
          child is connected to the parent.
docstr_tok: ["Merge","ancestor_relationship_columns","from","parent_df","into","child_df",",","adding","a","prefix","to","each","column","name","specifying","the","relationship",".","Return","the","updated","df","and","the","new","relationship","column","names",".","Args",":","child_df","(","pd.DataFrame",")",":","The","dataframe","to","add","relationship","columns","to",".","parent_df","(","pd.DataFrame",")",":","The","dataframe","to","copy","relationship","columns","from",".","ancestor_relationship_columns","(","list","[","str","]",")",":","The","names","of","relationship","columns","in","the","parent_df","to","copy","into","child_df",".","relationship","(","Relationship",")",":","the","relationship","through","which","the","child","is","connected","to","the","parent","."]
code: def _add_ancestor_relationship_columns(
      self,
      child_df,
      parent_df,
      ancestor_relationship_columns,
      relationship,
  ):
      """
      Merge ancestor_relationship_columns from parent_df into child_df, adding a prefix to
      each column name specifying the relationship.
  
      Return the updated df and the new relationship column names.
  
      Args:
          child_df (pd.DataFrame): The dataframe to add relationship columns to.
          parent_df (pd.DataFrame): The dataframe to copy relationship columns from.
          ancestor_relationship_columns (list[str]): The names of
              relationship columns in the parent_df to copy into child_df.
          relationship (Relationship): the relationship through which the
              child is connected to the parent.
      """
      relationship_name = relationship.parent_name
      new_relationship_columns = [
          "%s.%s" % (relationship_name, col)
          for col in ancestor_relationship_columns
      ]
  
      # create an intermediate dataframe which shares a column
      # with the child dataframe and has a column with the
      # original parent's id.
      col_map = {
          relationship._parent_column_name: relationship._child_column_name
      }
      for child_column, parent_column in zip(
          new_relationship_columns,
          ancestor_relationship_columns,
      ):
          col_map[parent_column] = child_column
  
      merge_df = parent_df[list(col_map.keys())].rename(columns=col_map)
  
      merge_df.index.name = None  # change index name for merge
  
      # Merge the dataframe, adding the relationship columns to the child.
      # Left outer join so that all rows in child are kept (if it contains
      # all rows of the dataframe then there may not be corresponding rows in the
      # parent_df).
      df = child_df.merge(
          merge_df,
          how="left",
          left_on=relationship._child_column_name,
          right_on=relationship._child_column_name,
      )
  
      # ensure index is maintained
      # TODO: Review for dask dataframes
      if isinstance(df, pd.DataFrame):
          df.set_index(
              relationship.child_dataframe.ww.index,
              drop=False,
              inplace=True,
          )
  
      return df, new_relationship_columns
  
imports: from datetime import datetime
  from functools import partial
  import numpy
  import pandas
  import pandas.api.types
  from featuretools.entityset.relationship import RelationshipPath
  from featuretools.exceptions import UnknownFeature
  from featuretools.feature_base import AggregationFeature, DirectFeature, GroupByTransformFeature, IdentityFeature, TransformFeature
  from featuretools.utils import Trie
  from featuretools.utils.gen_utils import Library, get_relationship_column_id, import_or_none, is_instance
label_desc: Use image node_id 5 for calling the FeatureSetCalculator obj's underlying member method code with example usage: obj._add_ancestor_relationship_columns(child_df, parent_df, ancestor_relationship_columns, relationship) and returns: df,  new_relationship_columns