class_docstr: Represents an immutable set of features to be calculated for a single dataframe, and their
  dependencies.
class_docstr_tok: ["Represents","an","immutable","set","of","features","to","be","calculated","for","a","single","dataframe",",","and","their","dependencies","."]
docstr: Add the given feature to the root of the trie, and recurse on its dependencies. If it is in
  approximate_feature_trie then it will not be added and we will not recurse on its dependencies.
docstr_tok: ["Add","the","given","feature","to","the","root","of","the","trie",",","and","recurse","on","its","dependencies",".","If","it","is","in","approximate_feature_trie","then","it","will","not","be","added","and","we","will","not","recurse","on","its","dependencies","."]
code: def _add_feature_to_trie(
      self,
      trie,
      feature,
      approximate_feature_trie,
      ancestor_needs_full_dataframe=False,
  ):
      """
      Add the given feature to the root of the trie, and recurse on its dependencies. If it is in
      approximate_feature_trie then it will not be added and we will not recurse on its dependencies.
      """
      (
          node_needs_full_dataframe,
          full_features,
          not_full_features,
      ) = trie.value
      needs_full_dataframe = (
          ancestor_needs_full_dataframe
          or self.uses_full_dataframe(feature)
      )
  
      name = feature.unique_name()
  
      # If this feature is ignored then don't add it or any of its dependencies.
      if name in approximate_feature_trie.value:
          return
  
      # Add the feature to one of the sets, depending on whether it needs the full dataframe.
      if needs_full_dataframe:
          full_features.add(name)
          if name in not_full_features:
              not_full_features.remove(name)
  
          # Update needs_full_dataframe for this node.
          trie.value = (True, full_features, not_full_features)
  
          # Set every node in relationship path to needs_full_dataframe.
          sub_trie = trie
          for edge in feature.relationship_path:
              sub_trie = sub_trie.get_node([edge])
              (_, f1, f2) = sub_trie.value
              sub_trie.value = (True, f1, f2)
      else:
          if name not in full_features:
              not_full_features.add(name)
  
          sub_trie = trie.get_node(feature.relationship_path)
  
      sub_ignored_trie = approximate_feature_trie.get_node(
          feature.relationship_path
      )
  
      for dep_feat in feature.get_dependencies():
          if isinstance(dep_feat, FeatureOutputSlice):
              dep_feat = dep_feat.base_feature
          self._add_feature_to_trie(
              sub_trie,
              dep_feat,
              sub_ignored_trie,
              ancestor_needs_full_dataframe=needs_full_dataframe,
          )
  
file_path: featuretools/featuretools/computational_backends/feature_set.py
imports: import itertools
  import logging
  from collections import defaultdict
  from featuretools.entityset.relationship import RelationshipPath
  from featuretools.feature_base import AggregationFeature, FeatureOutputSlice, GroupByTransformFeature, TransformFeature
  from featuretools.utils import Trie
label_desc: Use image node_id 4 for calling the FeatureSet obj's underlying member method code with example usage: obj._add_feature_to_trie(trie, feature, approximate_feature_trie, ancestor_needs_full_dataframe) without return types