def _build_where_clauses(self, all_features, entity): """Traverses all identity features and creates a Compare for each one, based on some heuristics Args: all_features (dict[Entity.id -> dict[str -> BaseFeature]]): Dict containing a dict for each entity. Each nested dict has features as values with their ids as keys. entity (Entity): Entity to calculate features for. """ identities = [ f for _, f in all_features[entity.id].items() if isinstance(f, IdentityFeature) ] for feat in identities: # Get interesting_values from the EntitySet that was passed, which # is assumed to be the most recent version of the EntitySet. # Features can contain a stale EntitySet reference without # interesting_values if entity[feat.variable.id].interesting_values is None: continue for val in entity[feat.variable.id].interesting_values: self.where_clauses[entity.id].add(Equals(feat, val))
def _build_where_clauses(self, all_features, entity): """Traverses all identity features and creates a Compare for each one, based on some heuristics Args: all_features (dict[Entity.id -> dict[str -> BaseFeature]]): Dict containing a dict for each entity. Each nested dict has features as values with their ids as keys. entity (Entity): Entity to calculate features for. """ identities = [ f for _, f in all_features[entity.id].items() if isinstance(f, IdentityFeature) ] for feat in identities: if feat.variable.interesting_values is None: continue for val in feat.variable.interesting_values: self.where_clauses[entity.id].add(Equals(feat, val))