MCPcopy
hub / github.com/PostHog/posthog / handle_compare

Function handle_compare

posthog/queries/base.py:60–73  ·  view source on GitHub ↗
(filter, func: Callable, team: Team, **kwargs)

Source from the content-addressed store, hash-verified

58
59
60def handle_compare(filter, func: Callable, team: Team, **kwargs) -> List:
61 all_entities = []
62 base_entitites = func(filter=filter, team=team, **kwargs)
63 if filter.compare:
64 base_entitites = convert_to_comparison(base_entitites, filter, "current")
65 all_entities.extend(base_entitites)
66
67 compared_filter = determine_compared_filter(filter)
68 comparison_entities = func(filter=compared_filter, team=team, **kwargs)
69 comparison_entities = convert_to_comparison(comparison_entities, compared_filter, "previous")
70 all_entities.extend(comparison_entities)
71 else:
72 all_entities.extend(base_entitites)
73 return all_entities
74
75
76def match_property(property: Property, override_property_values: Dict[str, Any]) -> bool:

Callers 2

runMethod · 0.90
runMethod · 0.90

Calls 2

convert_to_comparisonFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…