From 6259fece0ff718979e686a200f73465e781c82db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Diemer?= Date: Fri, 26 Jan 2024 14:17:12 +0100 Subject: [PATCH] python: remove manipulation of warnings config The removed lines prevent the application developer using this library to ignore these warnings with e.g. `pytest -W ignore::DeprecationWarning` --- python/sedona/core/jvm/config.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/python/sedona/core/jvm/config.py b/python/sedona/core/jvm/config.py index 3350fa8798..1ad1da12c7 100644 --- a/python/sedona/core/jvm/config.py +++ b/python/sedona/core/jvm/config.py @@ -18,7 +18,7 @@ import logging import os from re import findall -from typing import Any, Optional, Tuple +from typing import Optional, Tuple from py4j.protocol import Py4JJavaError from pyspark.sql import SparkSession @@ -89,13 +89,11 @@ def decorator(func1): @functools.wraps(func1) def new_func1(*args, **kwargs): - warnings.simplefilter('always', DeprecationWarning) warnings.warn( fmt1.format(name=func1.__name__, reason=reason), category=DeprecationWarning, stacklevel=2 ) - warnings.simplefilter('default', DeprecationWarning) return func1(*args, **kwargs) return new_func1 @@ -121,13 +119,11 @@ def new_func1(*args, **kwargs): @functools.wraps(func2) def new_func2(*args, **kwargs): - warnings.simplefilter('always', DeprecationWarning) warnings.warn( fmt2.format(name=func2.__name__), category=DeprecationWarning, stacklevel=2 ) - warnings.simplefilter('default', DeprecationWarning) return func2(*args, **kwargs) return new_func2