Skip to content

Commit 1fb95e6

Browse files
committed
tox files and missed tests
1 parent bf67ddc commit 1fb95e6

31 files changed

Lines changed: 58 additions & 161 deletions

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
exclude: '^(.*egg.info.*|.*/parameters.py|docs/).*$'
22
default_language_version:
3-
python: python3.9
3+
python: python3.10
44
repos:
55
- repo: https://github.com/asottile/pyupgrade
66
rev: v2.31.1

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ cd snowpark-python
3434
#### Install the library in edit mode and install its dependencies
3535

3636
- Create a new Python virtual environment with any Python version that we support.
37-
- The Snowpark Python API supports **Python 3.9, Python 3.10, Python 3.11, Python 3.12 and Python 3.13**.
38-
- The Snowpark pandas API supports **Python 3.9, Python 3.10, and Python 3.11**. Additionally, Snowpark pandas requires **Modin 0.36.x or 0.37.x**, and **pandas 2.2.x or 2.3.x**.
37+
- The Snowpark Python API supports **Python 3.10, Python 3.11, Python 3.12 and Python 3.13**.
38+
- The Snowpark pandas API supports **Python 3.10 and Python 3.11**. Additionally, Snowpark pandas requires **Modin 0.36.x or 0.37.x**, and **pandas 2.2.x or 2.3.x**.
3939

4040
```bash
41-
conda create --name snowpark-dev python=3.9
41+
conda create --name snowpark-dev python=3.10
4242
```
4343

4444
- Activate the new Python virtual environment. For example,

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ If you don't have a Snowflake account yet, you can [sign up for a 30-day free tr
1818

1919
### Create a Python virtual environment
2020
You can use [miniconda][miniconda], [anaconda][anaconda], or [virtualenv][virtualenv]
21-
to create a Python 3.9, 3.10, 3.11, 3.12 or 3.13 virtual environment.
21+
to create a Python 3.10, 3.11, 3.12 or 3.13 virtual environment.
2222

23-
For Snowpark pandas, only Python 3.9, 3.10, or 3.11 is supported.
23+
For Snowpark pandas, only Python 3.10 or 3.11 is supported.
2424

2525
To have the best experience when using it with UDFs, [creating a local conda environment with the Snowflake channel][use snowflake channel] is recommended.
2626

recipe/meta.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@ build:
1919
- SNOWFLAKE_IS_PYTHON_RUNTIME_TEST=1
2020
{% if noarch_build %}
2121
noarch: python
22-
string: "py39_{{ build_number }}" # [py==39]
2322
string: "py310_{{ build_number }}" # [py==310]
2423
string: "py311_{{ build_number }}" # [py==311]
2524
string: "py312_{{ build_number }}" # [py==312]
2625
string: "py313_{{ build_number }}" # [py==313]
2726
string: "py314_{{ build_number }}" # [py==314]
2827
{% endif %}
2928

30-
{% if noarch_build and py not in [39, 310, 311, 312, 313, 314] %}
31-
error: "Noarch build for Python version {{ py }} is not supported. Supported versions: 3.9, 3.10, 3.11, 3.12, 3.13, or 3.14."
29+
{% if noarch_build and py not in [310, 311, 312, 313, 314] %}
30+
error: "Noarch build for Python version {{ py }} is not supported. Supported versions: 3.10, 3.11, 3.12, 3.13, or 3.14."
3231
{% else %}
3332
requirements:
3433
host:
@@ -44,9 +43,7 @@ requirements:
4443
# mypy-protobuf 3.7.0 requires protobuf >= 5.26
4544
- mypy-protobuf <=3.6.0
4645
run:
47-
{% if noarch_build and py == 39 %}
48-
- python >=3.9,<3.10.0a0
49-
{% elif noarch_build and py == 310 %}
46+
{% if noarch_build and py == 310 %}
5047
- python >=3.10,<3.11.0a0
5148
{% elif noarch_build and py == 311 %}
5249
- python >=3.11,<3.12.0a0

scripts/conda_build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# Used internally by AnacondaPackageBuilder jobs
2-
conda build recipe/ -c sfe1ed40 --python=3.9 --numpy=1.19
32
conda build recipe/ -c sfe1ed40 --python=3.10 --numpy=1.21
43
conda build recipe/ -c sfe1ed40 --python=3.11 --numpy=1.23
54
conda build recipe/ -c sfe1ed40 --python=3.12 --numpy=1.26

scripts/conda_build_verification/README.md

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This directory contains scripts for Docker-based verification of Snowflake Snowp
44

55
## Overview
66

7-
The verification system automatically tests conda packages (.conda and .tar.bz2 formats) for **all Python versions 3.9-3.13** on both x86_64 and aarch64 architectures by:
7+
The verification system automatically tests conda packages (.conda and .tar.bz2 formats) for **all Python versions 3.10-3.13** on both x86_64 and aarch64 architectures by:
88

99
1. Scanning the `package/` directory for conda packages in `linux-64`, `linux-aarch64`, and `noarch` subdirectories
1010
2. Launching Docker containers using `continuumio/miniconda3` (supports both architectures)
@@ -27,20 +27,17 @@ The verification expects packages to be organized as follows:
2727
```
2828
package/
2929
├── linux-64/ # x86_64 packages
30-
│ ├── snowflake-snowpark-python-1.38.0-py39_0.conda
3130
│ ├── snowflake-snowpark-python-1.38.0-py310_0.conda
3231
│ ├── snowflake-snowpark-python-1.38.0-py311_0.conda
3332
│ ├── snowflake-snowpark-python-1.38.0-py312_0.conda
3433
│ ├── snowflake-snowpark-python-1.38.0-py313_0.conda
3534
│ └── ... (corresponding .tar.bz2 files)
3635
├── linux-aarch64/ # aarch64 packages
37-
│ ├── snowflake-snowpark-python-1.38.0-py39_0.conda
3836
│ ├── snowflake-snowpark-python-1.38.0-py310_0.conda
39-
│ └── ... (all Python versions 3.9-3.13)
37+
│ └── ... (all Python versions 3.10-3.13)
4038
└── noarch/ # Architecture-independent packages
41-
├── snowflake-snowpark-python-1.39.0-py39_0.conda
4239
├── snowflake-snowpark-python-1.39.0-py310_0.conda
43-
└── ... (all Python versions 3.9-3.13)
40+
└── ... (all Python versions 3.10-3.13)
4441
```
4542

4643
## Usage
@@ -50,7 +47,7 @@ package/
5047
**Prerequisites**: Ensure you have created `parameters.py` with valid Snowflake connection parameters (see Required Setup section above).
5148

5249
```bash
53-
# Test all Python versions (3.9-3.13) on noarch only
50+
# Test all Python versions (3.10-3.13) on noarch only
5451
./conda_build_verification.sh
5552

5653
# Test all Python versions on specific architecture(s)
@@ -105,10 +102,10 @@ Then run verification:
105102
- `architecture...` (optional): One or more architecture directories to test
106103
- Available: `linux-64`, `linux-aarch64`, `noarch`
107104
- Default: `noarch` only if no architectures specified
108-
- **Python versions**: Automatically tests all Python versions 3.9-3.13
105+
- **Python versions**: Automatically tests all Python versions 3.10-3.13
109106

110107
**Examples:**
111-
- `./conda_build_verification.sh` → Test all Python versions (3.9-3.13) on noarch
108+
- `./conda_build_verification.sh` → Test all Python versions (3.10-3.13) on noarch
112109
- `./conda_build_verification.sh linux-64` → Test all Python versions on linux-64 only
113110
- `./conda_build_verification.sh linux-64 noarch` → Test all Python versions on both linux-64 and noarch
114111
- `./conda_build_verification.sh linux-64 linux-aarch64 noarch` → Test all Python versions on all architectures
@@ -131,7 +128,7 @@ Then run verification:
131128
- Validates `parameters.py` file existence and provides helpful error messages if missing
132129
- Fails fast before any Docker operations begin
133130

134-
2. **Package Discovery**: Scans `package/linux-64`, `package/linux-aarch64`, and `package/noarch` for packages across all Python versions (3.9-3.13)
131+
2. **Package Discovery**: Scans `package/linux-64`, `package/linux-aarch64`, and `package/noarch` for packages across all Python versions (3.10-3.13)
135132
- **Strict Validation**: If packages are not found in any requested architecture directory, the script errors out immediately
136133

137134
3. **Docker Container Launch**: For each architecture with packages:
@@ -140,7 +137,7 @@ Then run verification:
140137
- Mounts verification scripts and package directory
141138
- Runs `docker_verify.sh` inside the container
142139

143-
4. **Package Testing**: Inside each container, for each Python version (3.9-3.13):
140+
4. **Package Testing**: Inside each container, for each Python version (3.10-3.13):
144141
- Creates isolated conda environment for the specific Python version
145142
- Installs package dependencies
146143
- Installs the conda package (.conda and .tar.bz2 formats) if available for that version
@@ -168,7 +165,7 @@ Docker uses the `--platform` flag to specify the target architecture:
168165
## Example Output
169166

170167
```
171-
Testing Python versions: 3.9, 3.10, 3.11, 3.12, 3.13
168+
Testing Python versions: 3.10, 3.11, 3.12, 3.13
172169
Using default architecture: noarch
173170
Testing architectures: noarch
174171
Script directory: /path/to/scripts/conda_build_verification
@@ -178,16 +175,9 @@ GPG_KEY found, attempting to decrypt parameters.py...
178175
Starting Docker-based conda package verification...
179176
Found packages in noarch
180177
=== Running verification for noarch ===
181-
Found packages in noarch, will test all Python versions (3.9-3.13)
178+
Found packages in noarch, will test all Python versions (3.10-3.13)
182179
Running Docker command for noarch...
183180
184-
=== Testing Python 3.9 ===
185-
Testing conda package: snowflake-snowpark-python-1.39.0-py39_0.conda
186-
✅ Package test completed successfully: snowflake-snowpark-python-1.39.0-py39_0.conda
187-
Testing tar.bz2 package: snowflake-snowpark-python-1.39.0-py39_0.tar.bz2
188-
✅ Package test completed successfully: snowflake-snowpark-python-1.39.0-py39_0.tar.bz2
189-
✅ All tests passed for Python 3.9
190-
191181
=== Testing Python 3.10 ===
192182
Testing conda package: snowflake-snowpark-python-1.39.0-py310_0.conda
193183
✅ Package test completed successfully: snowflake-snowpark-python-1.39.0-py310_0.conda
@@ -225,7 +215,7 @@ Removed decrypted parameters.py
225215
```
226216
This error occurs when the script cannot find packages for a requested architecture directory.
227217

228-
**To fix**: Ensure packages are in the correct `package/` subdirectories with proper naming patterns (e.g., `snowflake-snowpark-python-*-py39_*.conda`), or use one of the available architectures listed in the error message.
218+
**To fix**: Ensure packages are in the correct `package/` subdirectories with proper naming patterns (e.g., `snowflake-snowpark-python-*-py310_*.conda`), or use one of the available architectures listed in the error message.
229219

230220
3. **GPG decryption fails**
231221
```
@@ -294,7 +284,7 @@ docker run -it --rm \
294284
continuumio/miniconda3:latest \
295285
bash
296286

297-
# Inside container, run the verification script (tests all Python versions 3.9-3.13)
287+
# Inside container, run the verification script (tests all Python versions 3.10-3.13)
298288
bash /verification/docker_verify.sh
299289
```
300290

scripts/conda_build_verification/conda_build_verification.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Docker-based Snowflake Snowpark Python conda package verification
44
# Supports both x86_64 and aarch64 architectures using continuumio/miniconda3
5-
# Tests all Python versions (3.9-3.13) automatically
5+
# Tests all Python versions (3.10-3.13) automatically
66
#
77
# Usage: ./conda_build_verification.sh [architecture...]
88
#
@@ -27,7 +27,7 @@ fi
2727
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
2828
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
2929

30-
echo "Testing Python versions: 3.9, 3.10, 3.11, 3.12, 3.13"
30+
echo "Testing Python versions: 3.10, 3.11, 3.12, 3.13"
3131
echo "Testing architectures: ${PACKAGE_DIRS[*]}"
3232
echo "Script directory: $SCRIPT_DIR"
3333
echo "Project root: $PROJECT_ROOT"
@@ -81,7 +81,7 @@ run_docker_verification() {
8181
return 0
8282
fi
8383

84-
echo "Found packages in $arch_dir, will test all Python versions (3.9-3.13)"
84+
echo "Found packages in $arch_dir, will test all Python versions (3.10-3.13)"
8585

8686
# Create container name
8787
local container_name="snowpark-verify-${arch_dir}-$(date +%s)"

scripts/conda_build_verification/docker_verify.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
set -e
77

88
# List of Python versions to test
9-
PYTHON_VERSIONS=("3.9" "3.10" "3.11" "3.12" "3.13")
9+
PYTHON_VERSIONS=("3.10" "3.11" "3.12" "3.13")
1010

1111
echo "=== Docker Container Verification Script ==="
1212
echo "Python versions to test: ${PYTHON_VERSIONS[*]}"

setup.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
"python-dateutil", # Snowpark IR
3333
"tzlocal", # Snowpark IR
3434
]
35-
REQUIRED_PYTHON_VERSION = ">=3.9, <3.15"
35+
REQUIRED_PYTHON_VERSION = ">=3.10, <3.15"
3636

3737
if os.getenv("SNOWFLAKE_IS_PYTHON_RUNTIME_TEST", False):
38-
REQUIRED_PYTHON_VERSION = ">=3.9"
38+
REQUIRED_PYTHON_VERSION = ">=3.10"
3939

4040
PANDAS_REQUIREMENTS = [
4141
f"snowflake-connector-python[pandas]{CONNECTOR_DEPENDENCY_VERSION}",
@@ -246,7 +246,6 @@ def run(self):
246246
"Operating System :: OS Independent",
247247
"Programming Language :: SQL",
248248
"Programming Language :: Python :: 3 :: Only",
249-
"Programming Language :: Python :: 3.9",
250249
"Programming Language :: Python :: 3.10",
251250
"Programming Language :: Python :: 3.11",
252251
"Programming Language :: Python :: 3.12",

src/snowflake/snowpark/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,8 +1214,8 @@ def _parse_datatype_json_value(json_value: Union[dict, str]) -> DataType:
12141214

12151215
# TODO(SNOW-969479): Add a type hint that can be used to annotate Vector data. Python does not
12161216
# currently support integer type parameters (which are needed to represent a vector's dimension).
1217-
# typing.Annotate can be used as a temporary bypass once the minimum supported Python version is
1218-
# bumped to 3.9
1217+
# typing.Annotated can be used as a temporary bypass now that the minimum supported Python version
1218+
# is 3.10
12191219

12201220
#: The type hint for annotating TIMESTAMP_NTZ (e.g., ``Timestamp[NTZ]``) data when registering UDFs.
12211221
NTZ = TypeVar("NTZ")

0 commit comments

Comments
 (0)