Skip to content
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

Initialize Disabled Posthog Instance When API Key is Not Present #239

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Jul 4, 2023

This PR addresses the issue of initializing a disabled posthog instance when the POSTHOG_API_KEY is not present.

Previously, the posthog instance was set to None when the POSTHOG_API_KEY was not present. This has been modified so that a disabled posthog instance is initialized instead.

Additionally, a log statement at the warning level has been added to indicate the initialization of the empty posthog instance. This will aid in debugging and understanding the state of the application.

The changes are made in the sweepai/utils/event_logger.py file.

Fixes #236.

To checkout this PR branch, run the following command in your terminal:

git checkout sweep/feature/disabled-posthog-instance_1

Copy link
Contributor Author

@sweep-ai sweep-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No changes required. The modifications made in sweepai/utils/event_logger.py are appropriate. Good job on adding the functionality to initialize an empty Posthog instance and log a warning message when POSTHOG_API_KEY is not set. Also, the indentation correction in the code block that handles HIGHLIGHT_API_KEY is appreciated. Keep up the good work!

@asc11cat
Copy link
Contributor

asc11cat commented Jul 5, 2023

In disabled posthog instance, pass the "mock" string as an project_api_key, pass the host

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.

Sweep: Initialize a disabled posthog instance when posthog API key is not present
1 participant