Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix incorrect function names in deprecation warnings
Problem
start_profile_session()andstop_profile_session()are deprecated wrappers insentry_sdk/profiler/continuous_profiler.py. Their deprecation warnings tell users to migrate tostart_profileandstop_profilebut those functions do not exist in the codebase.Fix
Point the warnings to the correct replacement functions:
start_profilerandstop_profiler.def start_profile_session() -> None: warnings.warn( - "The `start_profile_session` function is deprecated. Please use `start_profile` instead.", + "The `start_profile_session` function is deprecated. Please use `start_profiler` instead.", DeprecationWarning, stacklevel=2, ) def stop_profile_session() -> None: warnings.warn( - "The `stop_profile_session` function is deprecated. Please use `stop_profile` instead.", + "The `stop_profile_session` function is deprecated. Please use `stop_profiler` instead.", DeprecationWarning, stacklevel=2, )Notes
The comment in
sentry_sdk/profiler/__init__.pyalready confirms the intent:The deprecation was implemented but with the wrong target name, so any user following
the warning would get a
AttributeErrortrying to call a function that doesn't exist.