Skip to content

Commit

Permalink
dont override global
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinjqliu committed Nov 20, 2024
1 parent 12e87a4 commit 769d9cf
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions pyiceberg/utils/deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@ def deprecation_message(deprecated_in: str, removed_in: str, help_message: Optio


def _deprecation_warning(message: str) -> None:
warnings.simplefilter("always", DeprecationWarning) # turn off filter

warnings.warn(
message,
category=DeprecationWarning,
stacklevel=2,
)
warnings.simplefilter("default", DeprecationWarning) # reset filter
with warnings.catch_warnings(): # temporarily override warning handling
warnings.simplefilter("always", DeprecationWarning) # turn off filter
warnings.warn(
message,
category=DeprecationWarning,
stacklevel=2,
)

0 comments on commit 769d9cf

Please sign in to comment.