You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I recently integrated posthog into our backend and I do not like that a posthog.capture can crash if the api key is not set even when I set posthog.disabled = True.
Traceback (most recent call last):
File "test.py", line 8, in <module>
posthog.capture("test", event="asd")
File "venv/lib/python3.12/site-packages/posthog/__init__.py", line 67, in capture
return _proxy(
^^^^^^^
File "venv/lib/python3.12/site-packages/posthog/__init__.py", line 497, in _proxy
default_client = Client(
^^^^^^^
File "venv/lib/python3.12/site-packages/posthog/client.py", line 69, in __init__
require("api_key", self.api_key, string_types)
File "venv/lib/python3.12/site-packages/posthog/client.py", line 941, in require
raise AssertionError(msg)
AssertionError: api_key must have (<class 'str'>,), got: None
To me this feels like a bug.
You can reproduce with
It happens on posthog==3.8.4 and posthog==3.9.3
If you agree that this should not be default behavior when posthog.disabled is set to True I can create a PR
The text was updated successfully, but these errors were encountered:
Hi,
I recently integrated posthog into our backend and I do not like that a
posthog.capture
can crash if the api key is not set even when I setposthog.disabled = True
.To me this feels like a bug.
You can reproduce with
It happens on posthog==3.8.4 and posthog==3.9.3
If you agree that this should not be default behavior when posthog.disabled is set to True I can create a PR
The text was updated successfully, but these errors were encountered: