Skip to content

add option to disable accurate warning file and line location #3006

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

Merged

Conversation

miguelgrinberg
Copy link
Contributor

Fixes #3003

This change provides a way to disable the calculations in function warn_stacklevel, which require introspection and are somewhat expensive when there are a large number of warnings.

To disable, set the DISABLE_WARN_STACKLEVEL environment variable to 1 or true:

export DISABLE_WARN_STACKLEVEL=1

@miguelgrinberg miguelgrinberg force-pushed the disable-warn-stack-level branch from 8c35076 to e1e2914 Compare July 28, 2025 15:29
@miguelgrinberg miguelgrinberg marked this pull request as ready for review July 28, 2025 15:35
@miguelgrinberg miguelgrinberg merged commit ee3f2d9 into elastic:main Jul 28, 2025
15 checks passed
@miguelgrinberg miguelgrinberg deleted the disable-warn-stack-level branch July 28, 2025 15:43
github-actions bot pushed a commit that referenced this pull request Jul 28, 2025
github-actions bot pushed a commit that referenced this pull request Jul 28, 2025
miguelgrinberg added a commit that referenced this pull request Jul 28, 2025
… warnings (Fixes #3003) (#3006) (#3007)

(cherry picked from commit ee3f2d9)

Co-authored-by: Miguel Grinberg <[email protected]>
miguelgrinberg added a commit that referenced this pull request Jul 28, 2025
… warnings (Fixes #3003) (#3006) (#3008)

(cherry picked from commit ee3f2d9)

Co-authored-by: Miguel Grinberg <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[8.18.1] warn_stacklevel is slowing down the client
1 participant