itholic commented on code in PR #48964:
URL: https://github.com/apache/spark/pull/48964#discussion_r1861629378
##########
python/pyspark/errors/utils.py:
##########
@@ -31,21 +31,41 @@
Type,
Optional,
Union,
- TYPE_CHECKING,
overload,
cast,
)
import pyspark
from pyspark.errors.error_classes import ERROR_CLASSES_MAP
-if TYPE_CHECKING:
- from pyspark.sql import SparkSession
-
T = TypeVar("T")
FuncT = TypeVar("FuncT", bound=Callable[..., Any])
_current_origin = threading.local()
+# Providing DataFrame debugging options to reduce performance slowdown.
+# Default is True.
+_enable_debugging_cache = None
+
+
+def is_debugging_enabled() -> bool:
+ global _enable_debugging_cache
+
+ if _enable_debugging_cache is None:
+ from pyspark.sql import SparkSession
+
+ spark = SparkSession.getActiveSession()
+ if spark is not None:
+ _enable_debugging_cache = (
+ spark.conf.get(
+ "spark.sql.dataFrameQueryContext.enabled", "true" # type:
ignore[union-attr]
Review Comment:
cc @vladimirg-db fyi
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]