Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release History

## 1.29.1 (2025-03-12)

### Snowpark Python API Updates

#### Bug Fixes

- Fixed a bug in `DataFrameReader.dbapi` (PrPr) that prevents usage in stored procedure and snowbooks.

## 1.29.0 (2025-03-05)

### Snowpark Python API Updates
Expand Down
1 change: 1 addition & 0 deletions docs/source/snowpark/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Input/Output

DataFrameReader.avro
DataFrameReader.csv
DataFrameReader.dbapi
DataFrameReader.format
DataFrameReader.json
DataFrameReader.load
Expand Down
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set name = "snowflake-snowpark-python" %}
{% set version = "1.29.0" %}
{% set version = "1.29.1" %}
{% set noarch_build = (os.environ.get('SNOWFLAKE_SNOWPARK_PYTHON_NOARCH_BUILD', 'false')) == 'true' %}

package:
Expand Down
18 changes: 16 additions & 2 deletions src/snowflake/snowpark/_internal/data_source_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
import datetime
import decimal
import logging
import os
import queue
from enum import Enum
from typing import List, Any, Tuple, Protocol, Optional
from typing import List, Any, Tuple, Protocol, Optional, Set
from snowflake.connector.options import pandas as pd

from snowflake.snowpark._internal.utils import get_sorted_key_for_version
Expand Down Expand Up @@ -294,7 +296,7 @@ def infer_data_source_schema(
except Exception as exc:
cursor.close()
raise SnowparkDataframeReaderException(
f"Failed to infer Snowpark DataFrame schema from '{table_or_query}'."
f"Failed to infer Snowpark DataFrame schema from '{table_or_query}' due to {exc!r}."
f" To avoid auto inference, you can manually specify the Snowpark DataFrame schema using 'custom_schema' in DataFrameReader.dbapi."
f" Please check the stack trace for more details."
) from exc
Expand Down Expand Up @@ -368,3 +370,15 @@ def output_type_handler(cursor, metadata):
return cursor.var(oracledb.DB_TYPE_LONG, arraysize=cursor.arraysize)
elif metadata.type_code == oracledb.DB_TYPE_BLOB:
return cursor.var(oracledb.DB_TYPE_RAW, arraysize=cursor.arraysize)


def add_unseen_files_to_process_queue(
work_dir: str, set_of_files_already_added_in_queue: Set[str], queue: queue.Queue
):
"""Add unseen files in the work_dir to the queue for processing."""
# all files in the work_dir are parquet files, no subdirectory
all_files = set(os.listdir(work_dir))
unseen = all_files - set_of_files_already_added_in_queue
for file in unseen:
queue.put(os.path.join(work_dir, file))
set_of_files_already_added_in_queue.add(file)
23 changes: 12 additions & 11 deletions src/snowflake/snowpark/_internal/proto/ast.proto
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ message PivotValue_Dataframe {
DataframeRef v = 1;
}

// const.ir:81
// const.ir:84
message PythonTimeZone {
google.protobuf.StringValue name = 1;
int64 offset_seconds = 2;
Expand Down Expand Up @@ -440,7 +440,7 @@ message Assign {
VarId var_id = 4;
}

// const.ir:28
// const.ir:31
message BigDecimalVal {
int64 scale = 1;
google.protobuf.StringValue special = 2;
Expand All @@ -450,8 +450,9 @@ message BigDecimalVal {

// const.ir:24
message BigIntVal {
SrcPosition src = 1;
bytes v = 2;
bool is_negative = 1;
SrcPosition src = 2;
bytes v = 3;
}

message BinOp {
Expand All @@ -476,7 +477,7 @@ message BinOp {
}
}

// const.ir:42
// const.ir:45
message BinaryVal {
SrcPosition src = 1;
bytes v = 2;
Expand Down Expand Up @@ -1292,7 +1293,7 @@ message DataframeWrite {
SrcPosition src = 5;
}

// const.ir:46
// const.ir:49
message DatatypeVal {
DataType datatype = 1;
SrcPosition src = 2;
Expand Down Expand Up @@ -1582,7 +1583,7 @@ message Flatten {
SrcPosition src = 6;
}

// const.ir:34
// const.ir:37
message Float64Val {
SrcPosition src = 1;
double v = 2;
Expand Down Expand Up @@ -1960,15 +1961,15 @@ message Pow {
SrcPosition src = 3;
}

// const.ir:65
// const.ir:68
message PythonDateVal {
int64 day = 1;
int64 month = 2;
SrcPosition src = 3;
int64 year = 4;
}

// const.ir:71
// const.ir:74
message PythonTimeVal {
int64 hour = 1;
int64 microsecond = 2;
Expand All @@ -1978,7 +1979,7 @@ message PythonTimeVal {
PythonTimeZone tz = 6;
}

// const.ir:54
// const.ir:57
message PythonTimestampVal {
int64 day = 1;
int64 hour = 2;
Expand Down Expand Up @@ -2198,7 +2199,7 @@ message StoredProcedure {
bool strict = 21;
}

// const.ir:38
// const.ir:41
message StringVal {
SrcPosition src = 1;
string v = 2;
Expand Down
Loading
Loading