From 0111689354df28df8fb2682939439da755df1b1d Mon Sep 17 00:00:00 2001 From: Filip Pawlowski Date: Thu, 6 Aug 2026 15:46:35 +0000 Subject: [PATCH] SNOW-2912540: add IS_V5_DRIVER constant for version-conditioned connector imports connector_version is already imported in utils.py; this one-liner exposes a boolean flag so callers can gate imports or behavior that differs between the legacy connector (v3/v4) and the Universal Driver (v5+). Co-Authored-By: Claude Sonnet 4.6 --- src/snowflake/snowpark/_internal/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/snowflake/snowpark/_internal/utils.py b/src/snowflake/snowpark/_internal/utils.py index 99dc105b37..109f5ac422 100644 --- a/src/snowflake/snowpark/_internal/utils.py +++ b/src/snowflake/snowpark/_internal/utils.py @@ -367,6 +367,8 @@ def is_interactive() -> bool: return hasattr(sys, "ps1") or sys.flags.interactive or "snowbook" in sys.modules +IS_V5_DRIVER: bool = connector_version[0] >= 5 + @lru_cache def get_connector_version() -> str: return ".".join([str(d) for d in connector_version if d is not None])