Skip to content

Commit 567870d

Browse files
sfc-gh-anavalosSnowflake Authors
andauthored
Project import generated by Copybara. (#182)
GitOrigin-RevId: 2ce5105f748ba10b7703a80bc0710ce22aaaf552 Co-authored-by: Snowflake Authors <[email protected]>
1 parent 17a5728 commit 567870d

File tree

78 files changed

+4104
-916
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+4104
-916
lines changed

CHANGELOG.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
# Release History
22

3+
## 1.17.0
4+
5+
### Bug Fixes
6+
7+
* ML Job: Added support for retrieving details of deleted jobs, including status, compute pool, and target instances.
8+
9+
### Behavior Changes
10+
11+
### New Features
12+
13+
* Support xgboost 3.x.
14+
* ML Job: Overhauled the `MLJob.result()` API with broader cross-version
15+
compatibility and support for additional data types, namely:
16+
* Pandas DataFrames
17+
* PyArrow Tables
18+
* NumPy arrays
19+
* NOTE: Requires `snowflake-ml-python>=1.17.0` to be installed inside remote container environment.
20+
* ML Job: Enabled job submission v2 by default
21+
* Jobs submitted using v2 will automatically use the latest Container Runtime image
22+
* v1 behavior can be restored by setting environment variable `MLRS_USE_SUBMIT_JOB_V2` to `false`
23+
324
## 1.16.0
425

526
### Bug Fixes
@@ -34,9 +55,10 @@ options = {
3455
"function_type": "TABLE_FUNCTION",
3556
"volatility": Volatility.VOLATILE,
3657
},
58+
},
3759
}
3860

39-
````
61+
```
4062

4163
## 1.15.0 (09-29-2025)
4264

bazel/BUILD.bazel

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,6 @@ py_binary(
2828
srcs_version = "PY3",
2929
)
3030

31-
py_binary(
32-
name = "add_pytest_marks",
33-
srcs = ["add_pytest_marks.py"],
34-
main = "add_pytest_marks.py",
35-
python_version = "PY3",
36-
srcs_version = "PY3",
37-
)
38-
3931
# Package group for common targets in the repo.
4032
package_group(
4133
name = "snowml_public_common",

bazel/add_pytest_marks.py

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

ci/build_and_run_tests.sh

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -236,22 +236,16 @@ pushd ${SNOWML_DIR}
236236
VERSION=$(grep -oE "VERSION = \"[0-9]+\\.[0-9]+\\.[0-9]+.*\"" snowflake/ml/version.py| cut -d'"' -f2)
237237
echo "Extracted Package Version from code: ${VERSION}"
238238

239-
# Generate and copy auto-gen tests with pytest marks.
239+
# Generate and copy auto-gen tests.
240240
"${BAZEL}" "${BAZEL_ADDITIONAL_STARTUP_FLAGS[@]+"${BAZEL_ADDITIONAL_STARTUP_FLAGS[@]}"}" build --config=build "${BAZEL_ADDITIONAL_BUILD_FLAGS[@]+"${BAZEL_ADDITIONAL_BUILD_FLAGS[@]}"}" //tests/integ/...
241241

242242
# Rsync cannot work well with path that has drive letter in Windows,
243243
# Thus, rsync has to use relative path instead of absolute ones.
244244

245245
rsync -av --exclude '*.runfiles_manifest' --exclude '*.runfiles/**' "bazel-bin/tests" .
246246

247-
if [[ -n "${FEATURE_AREAS}" ]]; then
248-
# Add pytest marks to all test files based on their feature: tags
249-
echo "Adding pytest marks to test files..."
250-
${PYTHON_EXECUTABLE} bazel/add_pytest_marks.py --targets //tests/integ/... --bazel-path "${BAZEL}"
251-
fi
252-
253247
# Read environments from optional_dependency_groups.bzl
254-
groups=()
248+
groups=("core")
255249
while IFS= read -r line; do
256250
groups+=("$line")
257251
done < <(python3 -c '
@@ -265,26 +259,35 @@ with open("bazel/platforms/optional_dependency_groups.bzl", "r") as f:
265259
print(group)
266260
')
267261

268-
groups+=("core")
269-
270262
for i in "${!groups[@]}"; do
271263
group="${groups[$i]}"
272264

273265
# Compare test required dependencies with wheel pkg dependencies and exclude tests if necessary
274266
EXCLUDE_TESTS=$(mktemp "${TEMP_TEST_DIR}/exclude_tests_${group}_XXXXX")
275-
./ci/get_excluded_tests.sh -f "${EXCLUDE_TESTS}" -m "${MODE}" -b "${BAZEL}" -e "${SF_ENV}" -g "${group}"
267+
268+
# Add feature area filtering if FEATURE_AREAS is set
269+
if [[ -n "${FEATURE_AREAS}" ]]; then
270+
echo "Applying feature area filter: ${FEATURE_AREAS}"
271+
./ci/get_excluded_tests.sh -f "${EXCLUDE_TESTS}" -m "${MODE}" -b "${BAZEL}" -e "${SF_ENV}" -g "${group}" -a "${FEATURE_AREAS}"
272+
else
273+
./ci/get_excluded_tests.sh -f "${EXCLUDE_TESTS}" -m "${MODE}" -b "${BAZEL}" -e "${SF_ENV}" -g "${group}"
274+
fi
276275

277276
# Copy tests into temp directory
278277
pushd "${TEMP_TEST_DIR}"
279-
rsync -av --exclude-from "${EXCLUDE_TESTS}" "../${SNOWML_DIR}/tests" "${group}"
278+
279+
# Copy from snowml root so exclude patterns can use "tests/integ/..." format
280+
rsync -av --exclude-from "${EXCLUDE_TESTS}" --include="tests/***" --exclude="*" "../${SNOWML_DIR}/" "${group}/"
280281
popd
281282
done
282283

283284
"${BAZEL}" "${BAZEL_ADDITIONAL_STARTUP_FLAGS[@]+"${BAZEL_ADDITIONAL_STARTUP_FLAGS[@]}"}" clean --expunge
284285
popd
285286

287+
286288
# Build snowml package
287289
if [ "${ENV}" = "pip" ]; then
290+
echo "Building snowml package: pip"
288291
# Clean build workspace
289292
rm -f "${WORKSPACE}"/*.whl
290293

@@ -340,6 +343,7 @@ if [[ "${WITH_SPCS_IMAGE}" = true ]]; then
340343
fi
341344

342345
# Start testing
346+
echo "Starting testing..."
343347
pushd "${TEMP_TEST_DIR}"
344348

345349
# Set up common pytest flag
@@ -350,24 +354,6 @@ COMMON_PYTEST_FLAG+=(--log-cli-level=INFO)
350354
COMMON_PYTEST_FLAG+=(-n logical)
351355
COMMON_PYTEST_FLAG+=(--timeout=3600)
352356

353-
# Add feature area filtering if specified
354-
if [[ -n "${FEATURE_AREAS}" ]]; then
355-
# Convert comma-separated list to pytest mark expression
356-
# e.g., "jobs,core" becomes "feature_area_jobs or feature_area_core"
357-
IFS=',' read -ra AREAS <<< "${FEATURE_AREAS}"
358-
MARK_EXPR=""
359-
for i in "${!AREAS[@]}"; do
360-
area="${AREAS[$i]}"
361-
if [[ $i -eq 0 ]]; then
362-
MARK_EXPR="feature_area_${area}"
363-
else
364-
MARK_EXPR="${MARK_EXPR} or feature_area_${area}"
365-
fi
366-
done
367-
COMMON_PYTEST_FLAG+=(-m "${MARK_EXPR}")
368-
echo "Running tests with feature area filter: ${MARK_EXPR}"
369-
fi
370-
371357
group_exit_codes=()
372358
group_coverage_report_files=()
373359

@@ -385,6 +371,7 @@ for i in "${!groups[@]}"; do
385371

386372
pushd "${group}"
387373
if [ "${ENV}" = "pip" ]; then
374+
echo "Testing with pip environment: ${group}"
388375
if [ "${WITH_SPCS_IMAGE}" = true ]; then
389376
COMMON_PYTEST_FLAG+=(-m "spcs_deployment_image and not pip_incompatible")
390377
else
@@ -414,6 +401,7 @@ for i in "${!groups[@]}"; do
414401
python -m pip list
415402

416403
# Run the tests
404+
echo "Running tests with pytest flags: ${COMMON_PYTEST_FLAG[*]}"
417405
set +e
418406
TEST_SRCDIR="${TEMP_TEST_DIR}" python -m pytest "${COMMON_PYTEST_FLAG[@]}" tests/integ/
419407
group_exit_codes[$i]=$?
@@ -447,6 +435,7 @@ for i in "${!groups[@]}"; do
447435
"${_MICROMAMBA_BIN}" list -p ./testenv
448436

449437
# Run integration tests
438+
echo "Running tests with pytest flags: ${COMMON_PYTEST_FLAG[*]}"
450439
set +e
451440
TEST_SRCDIR="${TEMP_TEST_DIR}" ${CONDA} run -p ./testenv --no-capture-output python -m pytest "${COMMON_PYTEST_FLAG[@]}" tests/integ/
452441
group_exit_codes[$i]=$?
@@ -510,7 +499,9 @@ fi
510499

511500
# Check all group exit codes
512501
for exit_code in "${group_exit_codes[@]}"; do
513-
if [[ (${MODE} = "merge_gate" || ${MODE} = "quarantined" || ${WITH_SPCS_IMAGE} = "true" ) && ${exit_code} -eq 5 ]]; then
502+
# Allow exit code 5 (no tests found) for all modes, as this is expected
503+
# when an optional dependency group has no tests
504+
if [[ ${exit_code} -eq 5 ]]; then
514505
continue
515506
fi
516507
if [[ ${exit_code} -ne 0 ]]; then

0 commit comments

Comments
 (0)