Skip to content

Commit 7c147a6

Browse files
committed
fixing types
1 parent 98ae309 commit 7c147a6

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

posthog/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
FlagsAndPayloads,
4545
FlagsResponse,
4646
FlagValue,
47+
SendFeatureFlagsOptions,
4748
normalize_flags_response,
4849
to_flags_and_payloads,
4950
to_payloads,
@@ -618,15 +619,15 @@ def capture(
618619

619620
return self._enqueue(msg, disable_geoip)
620621

621-
def _parse_send_feature_flags(self, send_feature_flags) -> dict:
622+
def _parse_send_feature_flags(self, send_feature_flags) -> SendFeatureFlagsOptions:
622623
"""
623624
Parse and normalize send_feature_flags parameter into a standard format.
624625
625626
Args:
626627
send_feature_flags: Either bool or SendFeatureFlagsOptions dict
627628
628629
Returns:
629-
dict: Normalized options with keys: should_send, only_evaluate_locally,
630+
SendFeatureFlagsOptions: Normalized options with keys: should_send, only_evaluate_locally,
630631
person_properties, group_properties, flag_keys_filter
631632
632633
Raises:

posthog/types.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
BeforeSendCallback = Callable[[dict[str, Any]], Optional[dict[str, Any]]]
1010

1111

12+
# Type alias for the send_feature_flags parameter
1213
class SendFeatureFlagsOptions(TypedDict, total=False):
1314
"""Options for sending feature flags with capture events.
1415
@@ -22,9 +23,11 @@ class SendFeatureFlagsOptions(TypedDict, total=False):
2223
Format: { group_type_name: { group_properties } }
2324
"""
2425

26+
should_send: bool
2527
only_evaluate_locally: Optional[bool]
2628
person_properties: Optional[dict[str, Any]]
2729
group_properties: Optional[dict[str, dict[str, Any]]]
30+
flag_keys_filter: Optional[list[str]]
2831

2932

3033
@dataclass(frozen=True)

0 commit comments

Comments
 (0)