Skip to content

BUG: Deprecation warnings with option_context have incorrect stacklevel #63235

@rhshadrach

Description

@rhshadrach

Ref: #63231 (comment)

When a option is deprecated and a user uses a pd.option_context to modify the setting, the warning stacklevel using find_stack_level() points at contextlib rather than the user's calling code. I believe find_stack_level() is not necessary here and the correct stacklevel can be set to a constant to avoid this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugWarningsWarnings that appear or should be added to pandas

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions