Skip to content

Commit 273c91f

Browse files
authored
Merge branch 'main' into aalam-SNOW-2257191-cte-join-bugfix
2 parents 67964ff + 68fd097 commit 273c91f

File tree

16 files changed

+176
-482
lines changed

16 files changed

+176
-482
lines changed

CHANGELOG.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,8 @@
5656
#### Improvements
5757

5858
- Enhanced `DataFrame.sort()` to support `ORDER BY ALL` when no columns are specified.
59-
- Catalog API now uses SQL commands instead of SnowAPI calls. This new implementation is more reliable now.
6059
- Removed experimental warning from `Session.cte_optimization_enabled`.
6160

62-
#### Dependency Updates
63-
64-
- Catalog API no longer uses types declared in `snowflake.core` and therefore this dependency was removed.
65-
6661
#### Bug Fixes
6762

6863
- Fixed with a bug when sql generation when joining two `DataFrame`s created using `DataFrame.alias` and CTE optimization is enabled.

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"pytest-assume", # sql counter check
6464
"decorator", # sql counter check
6565
"tox", # used for setting up testing environments
66+
"snowflake.core>=1.0.0, <2", # Catalog
6667
"psutil", # testing for telemetry
6768
"lxml", # used in XML reader unit tests
6869
]

src/snowflake/snowpark/_immutable_attr_dict.py

Lines changed: 0 additions & 180 deletions
This file was deleted.

src/snowflake/snowpark/_internal/data_source/utils.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import math
55
import os
66
import queue
7+
import re
78
import time
89
import traceback
910
import threading
@@ -46,10 +47,15 @@
4647
_MAX_RETRY_TIME = 3
4748
_MAX_WORKER_SCALE = 2 # 2 * max_workers
4849
STATEMENT_PARAMS_DATA_SOURCE = "SNOWPARK_PYTHON_DATASOURCE"
50+
STATEMENT_PARAMS_DATA_SOURCE_JDBC = "SNOWPARK_PYTHON_DATASOURCE_JDBC"
4951
DATA_SOURCE_DBAPI_SIGNATURE = "DataFrameReader.dbapi"
52+
DATA_SOURCE_JDBC_SIGNATURE = "DataFrameReader.jdbc"
5053
DATA_SOURCE_SQL_COMMENT = (
5154
f"/* Python:snowflake.snowpark.{DATA_SOURCE_DBAPI_SIGNATURE} */"
5255
)
56+
DATA_SOURCE_JDBC_SQL_COMMENT = (
57+
f"/* Python:snowflake.snowpark.{DATA_SOURCE_JDBC_SIGNATURE} */"
58+
)
5359
PARTITION_TASK_COMPLETE_SIGNAL_PREFIX = "PARTITION_COMPLETE_"
5460
PARTITION_TASK_ERROR_SIGNAL = "ERROR"
5561

@@ -109,6 +115,18 @@ class DRIVER_TYPE(str, Enum):
109115
}
110116

111117

118+
def get_jdbc_dbms(jdbc_url: str) -> str:
119+
"""
120+
Extract the DBMS name from a JDBC connection URL.
121+
"""
122+
if not jdbc_url.startswith("jdbc:"):
123+
return "connection url does not start with jdbc"
124+
125+
# Extract the DBMS type (first component after "jdbc:")
126+
match = re.match(r"^jdbc:([^:]+):", jdbc_url)
127+
return match.group(1).lower() if match else "unrecognized DBMS"
128+
129+
112130
def detect_dbms(dbapi2_conn) -> Tuple[DBMS_TYPE, DRIVER_TYPE]:
113131
"""Detects the DBMS type from a DBAPI2 connection."""
114132

0 commit comments

Comments
 (0)