Skip to content

Conversation

utkuzih
Copy link
Contributor

@utkuzih utkuzih commented May 24, 2022

Implemented send_feature_flags=False flag for the posthog.capture(...) call. Also added a new public function similar to the Javascript library: posthog.get_feature_variants(distinct_id, groups=None).

@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")
Copy link
Contributor

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? 🤔

Copy link
Contributor Author

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.

@utkuzih utkuzih requested a review from neilkakkar June 11, 2022 18:08
@neilkakkar
Copy link
Contributor

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 :)

@neilkakkar
Copy link
Contributor

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.

@neilkakkar
Copy link
Contributor

I couldn't push to your fork, so created a new PR instead 😅 . Thanks for working on this!

@neilkakkar neilkakkar closed this Jun 13, 2022
@utkuzih
Copy link
Contributor Author

utkuzih commented Jun 15, 2022

@neilkakkar Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants