Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions posthog/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1819,6 +1819,12 @@ def get_feature_flag_payload(
Category:
Feature flags
"""
warnings.warn(
"get_feature_flag_payload is deprecated and will be removed in a future version. "
"Please use get_feature_flag_result instead.",
DeprecationWarning,
stacklevel=2,
)
if send_feature_flag_events:
warnings.warn(
"send_feature_flag_events is deprecated in get_feature_flag_payload() and will be removed "
Expand Down
6 changes: 5 additions & 1 deletion posthog/test/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ def test_requires_api_key(self):

def test_empty_flush(self):
self.client.flush()

def test_get_feature_flag_payload_deprecation_warning(self):
# This tells Python: "Expect a DeprecationWarning in the next line"
with self.assertWarns(DeprecationWarning):
self.client.get_feature_flag_payload("key", "distinct_id")

def test_basic_capture(self):
with mock.patch("posthog.client.batch_post") as mock_post:
client = Client(FAKE_TEST_API_KEY, on_error=self.set_fail, sync_mode=True)
Expand Down