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,
            )

        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.
        
featuretools/computational_backends/feature_set.py