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

Method split

posthog/api/person.py:297–316  ·  view source on GitHub ↗
(self, request: request.Request, pk=None, **kwargs)

Source from the content-addressed store, hash-verified

295
296 @action(methods=["POST"], detail=True)
297 def split(self, request: request.Request, pk=None, **kwargs) -> response.Response:
298 person: Person = self.get_object()
299 distinct_ids = person.distinct_ids
300
301 split_person.delay(person.id, request.data.get("main_distinct_id", None))
302
303 log_activity(
304 organization_id=self.organization.id,
305 team_id=self.team.id,
306 user=request.user, # type: ignore
307 item_id=person.id,
308 scope="Person",
309 activity="split_person",
310 detail=Detail(
311 name=str(person.uuid),
312 changes=[Change(type="Person", action="split", after={"distinct_ids": distinct_ids})],
313 ),
314 )
315
316 return response.Response({"success": True}, status=201)
317
318 @extend_schema(
319 parameters=[

Callers 15

getInputFilesFunction · 0.80
printResponseFunction · 0.80
startServerFunction · 0.80
navigationLogic.tsFile · 0.80
insightActivityDescriberFunction · 0.80
TrendsFormulaFunction · 0.80
CorrelationActionsCellFunction · 0.80
CorrelationActionsCellFunction · 0.80
formatCompareLabelFunction · 0.80
IngestionWarningsViewFunction · 0.80
mathTypeToApiValuesFunction · 0.80

Calls 5

log_activityFunction · 0.90
DetailClass · 0.90
ChangeClass · 0.90
getMethod · 0.65
get_objectMethod · 0.45

Tested by 9

getUrlParametersFunction · 0.64
test_csv_export_newMethod · 0.64
test_people_csvMethod · 0.64
test_csv_renderingFunction · 0.64
_split_to_dictMethod · 0.64
cache_keysFunction · 0.64