-
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
Deprecate the context argument #182
Conversation
It's not used anywhere, a vestigial remnant of a time long ago.
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.
PR Summary
This PR deprecates and removes the unused 'context' parameter across the PostHog Python SDK, focusing on cleaning up legacy code.
- Added deprecation warnings using
warnings.warn()
withDeprecationWarning
in all relevant methods inposthog/__init__.py
- Removed context parameter from command line arguments and function calls in
simulator.py
- Updated test cases in
test_client.py
to use named parameters and removed context-related assertions - Maintained backward compatibility while signaling future removal of the parameter across all affected files
4 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile
def set_once(): | ||
posthog.set_once( | ||
options.distinct_id, | ||
properties=json_hash(options.traits), | ||
context=json_hash(options.context), | ||
) |
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.
style: set_once is using traits for properties parameter which may be confusing - consider renaming the command line arg to match the function signature
def set(): | ||
posthog.set( | ||
options.distinct_id, | ||
properties=json_hash(options.traits), | ||
context=json_hash(options.context), | ||
) |
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.
style: set is using traits for properties parameter which may be confusing - consider renaming the command line arg to match the function signature
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.
🎉
It's not used anywhere, a vestigial remnant of a time long ago.
This PR supercedes #54.