-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have an option to send feature variants with the .capture(...) calls. #64
Conversation
posthog/test/test_client.py
Outdated
@@ -417,7 +417,7 @@ def test_feature_enabled_simple(self, patch_get, patch_decide): | |||
@mock.patch("posthog.client.decide") | |||
@mock.patch("posthog.client.get") | |||
def test_feature_enabled_simple_is_false(self, patch_get, patch_decide): | |||
client = Client(TEST_API_KEY) | |||
client = Client(TEST_API_KEY, personal_api_key="test") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why'd you have to add this here? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ha, I was blindly adding the personal_api_key
to all tests which mocked client.decide
. No need in here.
Hey @utkuzih , apologies for taking a while. I wanted to confirm that the solution for PostHog/posthog#9547 wouldn't impact this in any way. Doesn't seem like it anymore, so I'll get this merged first thing Monday :) |
It would be nice to have a test or two for the new functionality as well. I'll add these myself on Monday if you don't get to it by then. |
I couldn't push to your fork, so created a new PR instead 😅 . Thanks for working on this! |
@neilkakkar Thank you! |
Implemented
send_feature_flags=False
flag for theposthog.capture(...)
call. Also added a new public function similar to the Javascript library:posthog.get_feature_variants(distinct_id, groups=None)
.