From f54ab9f3f6e22d72bcced74b1439dcabc459f618 Mon Sep 17 00:00:00 2001 From: Gokul Kannan Date: Thu, 17 Oct 2024 10:49:45 -0700 Subject: [PATCH] Project import generated by Copybara. (#120) GitOrigin-RevId: bbba74b134aa6fa9d66cb37f439477b0a94817b0 Co-authored-by: Snowflake Authors --- .bazelversion | 2 +- CHANGELOG.md | 8 ++++++- bazel/requirements/templates/meta.tpl.yaml | 2 +- ci/conda_recipe/meta.yaml | 4 ++-- snowflake/ml/model/_client/sql/service.py | 24 +++++-------------- .../ml/model/_client/sql/service_test.py | 7 ------ snowflake/ml/version.bzl | 2 +- 7 files changed, 18 insertions(+), 31 deletions(-) diff --git a/.bazelversion b/.bazelversion index 798e3899..91e4a9f2 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -6.3.0 +6.3.2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 269e9e4f..27ae19f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Release History -## 1.6.3 +## 1.6.4 + +### Bug Fixes + +- Registry: Fix an issue that leads to incident when using `ModelVersion.run` with service. + +## 1.6.3 (2024-10-07) - Model Registry (PrPr) has been removed. diff --git a/bazel/requirements/templates/meta.tpl.yaml b/bazel/requirements/templates/meta.tpl.yaml index 36556103..19405abe 100644 --- a/bazel/requirements/templates/meta.tpl.yaml +++ b/bazel/requirements/templates/meta.tpl.yaml @@ -11,7 +11,7 @@ build: requirements: build: - python - - bazel==6.3.0 + - bazel==6.3.2 run: - python>=3.8,<3.12 diff --git a/ci/conda_recipe/meta.yaml b/ci/conda_recipe/meta.yaml index c03b1964..e2f87876 100644 --- a/ci/conda_recipe/meta.yaml +++ b/ci/conda_recipe/meta.yaml @@ -17,11 +17,11 @@ build: noarch: python package: name: snowflake-ml-python - version: 1.6.3 + version: 1.6.4 requirements: build: - python - - bazel==6.3.0 + - bazel==6.3.2 run: - absl-py>=0.15,<2 - aiohttp!=4.0.0a0, !=4.0.0a1 diff --git a/snowflake/ml/model/_client/sql/service.py b/snowflake/ml/model/_client/sql/service.py index 43293010..6033bffc 100644 --- a/snowflake/ml/model/_client/sql/service.py +++ b/snowflake/ml/model/_client/sql/service.py @@ -3,13 +3,10 @@ import textwrap from typing import Any, Dict, List, Optional, Tuple -from packaging import version - from snowflake import snowpark from snowflake.ml._internal.utils import ( identifier, query_result_checker, - snowflake_env, sql_identifier, ) from snowflake.ml.model._client.sql import _base @@ -120,21 +117,12 @@ def invoke_function_method( args_sql_list.append(input_arg_value) args_sql = ", ".join(args_sql_list) - if snowflake_env.get_current_snowflake_version( - self._session, statement_params=statement_params - ) >= version.parse("8.39.0"): - fully_qualified_service_name = self.fully_qualified_object_name( - actual_database_name, actual_schema_name, service_name - ) - fully_qualified_function_name = f"{fully_qualified_service_name}!{method_name.identifier()}" - - else: - function_name = identifier.concat_names([service_name.identifier(), "_", method_name.identifier()]) - fully_qualified_function_name = identifier.get_schema_level_object_identifier( - actual_database_name.identifier(), - actual_schema_name.identifier(), - function_name, - ) + function_name = identifier.concat_names([service_name.identifier(), "_", method_name.identifier()]) + fully_qualified_function_name = identifier.get_schema_level_object_identifier( + actual_database_name.identifier(), + actual_schema_name.identifier(), + function_name, + ) sql = textwrap.dedent( f"""{with_sql} diff --git a/snowflake/ml/model/_client/sql/service_test.py b/snowflake/ml/model/_client/sql/service_test.py index 38806a37..385cf913 100644 --- a/snowflake/ml/model/_client/sql/service_test.py +++ b/snowflake/ml/model/_client/sql/service_test.py @@ -102,8 +102,6 @@ def test_deploy_model(self) -> None: def test_invoke_function_method(self) -> None: m_statement_params = {"test": "1"} m_df = mock_data_frame.MockDataFrame() - m_df0 = mock_data_frame.MockDataFrame(collect_result=[Row(CURRENT_VERSION="1")]) - self.m_session.add_mock_sql("SELECT CURRENT_VERSION() AS CURRENT_VERSION", m_df0) self.m_session.add_mock_sql( """SELECT *, @@ -143,9 +141,6 @@ def test_invoke_function_method(self) -> None: def test_invoke_function_method_1(self) -> None: m_statement_params = {"test": "1"} - m_df0 = mock_data_frame.MockDataFrame(collect_result=[Row(CURRENT_VERSION="1")]) - self.m_session.add_mock_sql("SELECT CURRENT_VERSION() AS CURRENT_VERSION", m_df0) - m_df = mock_data_frame.MockDataFrame() self.m_session.add_mock_sql( """SELECT *, @@ -188,8 +183,6 @@ def test_invoke_function_method_1(self) -> None: def test_invoke_function_method_2(self) -> None: m_statement_params = {"test": "1"} - m_df0 = mock_data_frame.MockDataFrame(collect_result=[Row(CURRENT_VERSION="1")]) - self.m_session.add_mock_sql("SELECT CURRENT_VERSION() AS CURRENT_VERSION", m_df0) m_df = mock_data_frame.MockDataFrame() self.m_session.add_mock_sql( """WITH SNOWPARK_ML_MODEL_INFERENCE_INPUT_ABCDEF0123 AS (query_1) diff --git a/snowflake/ml/version.bzl b/snowflake/ml/version.bzl index e1060d5b..2d2065a2 100644 --- a/snowflake/ml/version.bzl +++ b/snowflake/ml/version.bzl @@ -1,2 +1,2 @@ # This is parsed by regex in conda reciper meta file. Make sure not to break it. -VERSION = "1.6.3" +VERSION = "1.6.4"