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
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Release History

## 1.17.0

### Bug Fixes

* ML Job: Added support for retrieving details of deleted jobs, including status, compute pool, and target instances.

### Behavior Changes

### New Features

* Support xgboost 3.x.
* ML Job: Overhauled the `MLJob.result()` API with broader cross-version
compatibility and support for additional data types, namely:
* Pandas DataFrames
* PyArrow Tables
* NumPy arrays
* NOTE: Requires `snowflake-ml-python>=1.17.0` to be installed inside remote container environment.
* ML Job: Enabled job submission v2 by default
* Jobs submitted using v2 will automatically use the latest Container Runtime image
* v1 behavior can be restored by setting environment variable `MLRS_USE_SUBMIT_JOB_V2` to `false`

## 1.16.0

### Bug Fixes
Expand Down Expand Up @@ -34,9 +55,10 @@ options = {
"function_type": "TABLE_FUNCTION",
"volatility": Volatility.VOLATILE,
},
},
}

````
```

## 1.15.0 (09-29-2025)

Expand Down
8 changes: 0 additions & 8 deletions bazel/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ py_binary(
srcs_version = "PY3",
)

py_binary(
name = "add_pytest_marks",
srcs = ["add_pytest_marks.py"],
main = "add_pytest_marks.py",
python_version = "PY3",
srcs_version = "PY3",
)

# Package group for common targets in the repo.
package_group(
name = "snowml_public_common",
Expand Down
203 changes: 0 additions & 203 deletions bazel/add_pytest_marks.py

This file was deleted.

53 changes: 22 additions & 31 deletions ci/build_and_run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -236,22 +236,16 @@ pushd ${SNOWML_DIR}
VERSION=$(grep -oE "VERSION = \"[0-9]+\\.[0-9]+\\.[0-9]+.*\"" snowflake/ml/version.py| cut -d'"' -f2)
echo "Extracted Package Version from code: ${VERSION}"

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

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

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

if [[ -n "${FEATURE_AREAS}" ]]; then
# Add pytest marks to all test files based on their feature: tags
echo "Adding pytest marks to test files..."
${PYTHON_EXECUTABLE} bazel/add_pytest_marks.py --targets //tests/integ/... --bazel-path "${BAZEL}"
fi

# Read environments from optional_dependency_groups.bzl
groups=()
groups=("core")
while IFS= read -r line; do
groups+=("$line")
done < <(python3 -c '
Expand All @@ -265,26 +259,35 @@ with open("bazel/platforms/optional_dependency_groups.bzl", "r") as f:
print(group)
')

groups+=("core")

for i in "${!groups[@]}"; do
group="${groups[$i]}"

# Compare test required dependencies with wheel pkg dependencies and exclude tests if necessary
EXCLUDE_TESTS=$(mktemp "${TEMP_TEST_DIR}/exclude_tests_${group}_XXXXX")
./ci/get_excluded_tests.sh -f "${EXCLUDE_TESTS}" -m "${MODE}" -b "${BAZEL}" -e "${SF_ENV}" -g "${group}"

# Add feature area filtering if FEATURE_AREAS is set
if [[ -n "${FEATURE_AREAS}" ]]; then
echo "Applying feature area filter: ${FEATURE_AREAS}"
./ci/get_excluded_tests.sh -f "${EXCLUDE_TESTS}" -m "${MODE}" -b "${BAZEL}" -e "${SF_ENV}" -g "${group}" -a "${FEATURE_AREAS}"
else
./ci/get_excluded_tests.sh -f "${EXCLUDE_TESTS}" -m "${MODE}" -b "${BAZEL}" -e "${SF_ENV}" -g "${group}"
fi

# Copy tests into temp directory
pushd "${TEMP_TEST_DIR}"
rsync -av --exclude-from "${EXCLUDE_TESTS}" "../${SNOWML_DIR}/tests" "${group}"

# Copy from snowml root so exclude patterns can use "tests/integ/..." format
rsync -av --exclude-from "${EXCLUDE_TESTS}" --include="tests/***" --exclude="*" "../${SNOWML_DIR}/" "${group}/"
popd
done

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


# Build snowml package
if [ "${ENV}" = "pip" ]; then
echo "Building snowml package: pip"
# Clean build workspace
rm -f "${WORKSPACE}"/*.whl

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

# Start testing
echo "Starting testing..."
pushd "${TEMP_TEST_DIR}"

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

# Add feature area filtering if specified
if [[ -n "${FEATURE_AREAS}" ]]; then
# Convert comma-separated list to pytest mark expression
# e.g., "jobs,core" becomes "feature_area_jobs or feature_area_core"
IFS=',' read -ra AREAS <<< "${FEATURE_AREAS}"
MARK_EXPR=""
for i in "${!AREAS[@]}"; do
area="${AREAS[$i]}"
if [[ $i -eq 0 ]]; then
MARK_EXPR="feature_area_${area}"
else
MARK_EXPR="${MARK_EXPR} or feature_area_${area}"
fi
done
COMMON_PYTEST_FLAG+=(-m "${MARK_EXPR}")
echo "Running tests with feature area filter: ${MARK_EXPR}"
fi

group_exit_codes=()
group_coverage_report_files=()

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

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

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

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

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