snowflake-ml-python 1.14.0__py3-none-any.whl → 1.16.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. snowflake/ml/_internal/platform_capabilities.py +13 -7
  2. snowflake/ml/_internal/utils/connection_params.py +5 -3
  3. snowflake/ml/_internal/utils/jwt_generator.py +3 -2
  4. snowflake/ml/_internal/utils/mixins.py +24 -9
  5. snowflake/ml/_internal/utils/temp_file_utils.py +1 -2
  6. snowflake/ml/experiment/_client/experiment_tracking_sql_client.py +16 -3
  7. snowflake/ml/experiment/_entities/__init__.py +2 -1
  8. snowflake/ml/experiment/_entities/run.py +0 -15
  9. snowflake/ml/experiment/_entities/run_metadata.py +3 -51
  10. snowflake/ml/experiment/experiment_tracking.py +71 -27
  11. snowflake/ml/jobs/_utils/spec_utils.py +49 -11
  12. snowflake/ml/jobs/manager.py +20 -0
  13. snowflake/ml/model/__init__.py +12 -2
  14. snowflake/ml/model/_client/model/batch_inference_specs.py +16 -4
  15. snowflake/ml/model/_client/model/inference_engine_utils.py +55 -0
  16. snowflake/ml/model/_client/model/model_version_impl.py +30 -62
  17. snowflake/ml/model/_client/ops/service_ops.py +68 -7
  18. snowflake/ml/model/_client/service/model_deployment_spec.py +1 -1
  19. snowflake/ml/model/_client/sql/service.py +29 -2
  20. snowflake/ml/model/_client/sql/stage.py +8 -0
  21. snowflake/ml/model/_model_composer/model_manifest/model_manifest_schema.py +1 -0
  22. snowflake/ml/model/_model_composer/model_method/model_method.py +25 -2
  23. snowflake/ml/model/_packager/model_env/model_env.py +26 -16
  24. snowflake/ml/model/_packager/model_handlers/_utils.py +4 -2
  25. snowflake/ml/model/_packager/model_handlers/huggingface_pipeline.py +7 -5
  26. snowflake/ml/model/_packager/model_packager.py +4 -3
  27. snowflake/ml/model/_packager/model_runtime/_snowml_inference_alternative_requirements.py +1 -2
  28. snowflake/ml/model/_signatures/utils.py +0 -21
  29. snowflake/ml/model/models/huggingface_pipeline.py +56 -21
  30. snowflake/ml/model/type_hints.py +13 -0
  31. snowflake/ml/model/volatility.py +34 -0
  32. snowflake/ml/modeling/calibration/calibrated_classifier_cv.py +1 -1
  33. snowflake/ml/modeling/cluster/affinity_propagation.py +1 -1
  34. snowflake/ml/modeling/cluster/agglomerative_clustering.py +1 -1
  35. snowflake/ml/modeling/cluster/birch.py +1 -1
  36. snowflake/ml/modeling/cluster/bisecting_k_means.py +1 -1
  37. snowflake/ml/modeling/cluster/dbscan.py +1 -1
  38. snowflake/ml/modeling/cluster/feature_agglomeration.py +1 -1
  39. snowflake/ml/modeling/cluster/k_means.py +1 -1
  40. snowflake/ml/modeling/cluster/mean_shift.py +1 -1
  41. snowflake/ml/modeling/cluster/mini_batch_k_means.py +1 -1
  42. snowflake/ml/modeling/cluster/optics.py +1 -1
  43. snowflake/ml/modeling/cluster/spectral_biclustering.py +1 -1
  44. snowflake/ml/modeling/cluster/spectral_clustering.py +1 -1
  45. snowflake/ml/modeling/cluster/spectral_coclustering.py +1 -1
  46. snowflake/ml/modeling/compose/column_transformer.py +1 -1
  47. snowflake/ml/modeling/compose/transformed_target_regressor.py +1 -1
  48. snowflake/ml/modeling/covariance/elliptic_envelope.py +1 -1
  49. snowflake/ml/modeling/covariance/empirical_covariance.py +1 -1
  50. snowflake/ml/modeling/covariance/graphical_lasso.py +1 -1
  51. snowflake/ml/modeling/covariance/graphical_lasso_cv.py +1 -1
  52. snowflake/ml/modeling/covariance/ledoit_wolf.py +1 -1
  53. snowflake/ml/modeling/covariance/min_cov_det.py +1 -1
  54. snowflake/ml/modeling/covariance/oas.py +1 -1
  55. snowflake/ml/modeling/covariance/shrunk_covariance.py +1 -1
  56. snowflake/ml/modeling/decomposition/dictionary_learning.py +1 -1
  57. snowflake/ml/modeling/decomposition/factor_analysis.py +1 -1
  58. snowflake/ml/modeling/decomposition/fast_ica.py +1 -1
  59. snowflake/ml/modeling/decomposition/incremental_pca.py +1 -1
  60. snowflake/ml/modeling/decomposition/kernel_pca.py +1 -1
  61. snowflake/ml/modeling/decomposition/mini_batch_dictionary_learning.py +1 -1
  62. snowflake/ml/modeling/decomposition/mini_batch_sparse_pca.py +1 -1
  63. snowflake/ml/modeling/decomposition/pca.py +1 -1
  64. snowflake/ml/modeling/decomposition/sparse_pca.py +1 -1
  65. snowflake/ml/modeling/decomposition/truncated_svd.py +1 -1
  66. snowflake/ml/modeling/discriminant_analysis/linear_discriminant_analysis.py +1 -1
  67. snowflake/ml/modeling/discriminant_analysis/quadratic_discriminant_analysis.py +1 -1
  68. snowflake/ml/modeling/ensemble/ada_boost_classifier.py +1 -1
  69. snowflake/ml/modeling/ensemble/ada_boost_regressor.py +1 -1
  70. snowflake/ml/modeling/ensemble/bagging_classifier.py +1 -1
  71. snowflake/ml/modeling/ensemble/bagging_regressor.py +1 -1
  72. snowflake/ml/modeling/ensemble/extra_trees_classifier.py +1 -1
  73. snowflake/ml/modeling/ensemble/extra_trees_regressor.py +1 -1
  74. snowflake/ml/modeling/ensemble/gradient_boosting_classifier.py +1 -1
  75. snowflake/ml/modeling/ensemble/gradient_boosting_regressor.py +1 -1
  76. snowflake/ml/modeling/ensemble/hist_gradient_boosting_classifier.py +1 -1
  77. snowflake/ml/modeling/ensemble/hist_gradient_boosting_regressor.py +1 -1
  78. snowflake/ml/modeling/ensemble/isolation_forest.py +1 -1
  79. snowflake/ml/modeling/ensemble/random_forest_classifier.py +1 -1
  80. snowflake/ml/modeling/ensemble/random_forest_regressor.py +1 -1
  81. snowflake/ml/modeling/ensemble/stacking_regressor.py +1 -1
  82. snowflake/ml/modeling/ensemble/voting_classifier.py +1 -1
  83. snowflake/ml/modeling/ensemble/voting_regressor.py +1 -1
  84. snowflake/ml/modeling/feature_selection/generic_univariate_select.py +1 -1
  85. snowflake/ml/modeling/feature_selection/select_fdr.py +1 -1
  86. snowflake/ml/modeling/feature_selection/select_fpr.py +1 -1
  87. snowflake/ml/modeling/feature_selection/select_fwe.py +1 -1
  88. snowflake/ml/modeling/feature_selection/select_k_best.py +1 -1
  89. snowflake/ml/modeling/feature_selection/select_percentile.py +1 -1
  90. snowflake/ml/modeling/feature_selection/sequential_feature_selector.py +1 -1
  91. snowflake/ml/modeling/feature_selection/variance_threshold.py +1 -1
  92. snowflake/ml/modeling/gaussian_process/gaussian_process_classifier.py +1 -1
  93. snowflake/ml/modeling/gaussian_process/gaussian_process_regressor.py +1 -1
  94. snowflake/ml/modeling/impute/iterative_imputer.py +1 -1
  95. snowflake/ml/modeling/impute/knn_imputer.py +1 -1
  96. snowflake/ml/modeling/impute/missing_indicator.py +1 -1
  97. snowflake/ml/modeling/kernel_approximation/additive_chi2_sampler.py +1 -1
  98. snowflake/ml/modeling/kernel_approximation/nystroem.py +1 -1
  99. snowflake/ml/modeling/kernel_approximation/polynomial_count_sketch.py +1 -1
  100. snowflake/ml/modeling/kernel_approximation/rbf_sampler.py +1 -1
  101. snowflake/ml/modeling/kernel_approximation/skewed_chi2_sampler.py +1 -1
  102. snowflake/ml/modeling/kernel_ridge/kernel_ridge.py +1 -1
  103. snowflake/ml/modeling/lightgbm/lgbm_classifier.py +1 -1
  104. snowflake/ml/modeling/lightgbm/lgbm_regressor.py +1 -1
  105. snowflake/ml/modeling/linear_model/ard_regression.py +1 -1
  106. snowflake/ml/modeling/linear_model/bayesian_ridge.py +1 -1
  107. snowflake/ml/modeling/linear_model/elastic_net.py +1 -1
  108. snowflake/ml/modeling/linear_model/elastic_net_cv.py +1 -1
  109. snowflake/ml/modeling/linear_model/gamma_regressor.py +1 -1
  110. snowflake/ml/modeling/linear_model/huber_regressor.py +1 -1
  111. snowflake/ml/modeling/linear_model/lars.py +1 -1
  112. snowflake/ml/modeling/linear_model/lars_cv.py +1 -1
  113. snowflake/ml/modeling/linear_model/lasso.py +1 -1
  114. snowflake/ml/modeling/linear_model/lasso_cv.py +1 -1
  115. snowflake/ml/modeling/linear_model/lasso_lars.py +1 -1
  116. snowflake/ml/modeling/linear_model/lasso_lars_cv.py +1 -1
  117. snowflake/ml/modeling/linear_model/lasso_lars_ic.py +1 -1
  118. snowflake/ml/modeling/linear_model/linear_regression.py +1 -1
  119. snowflake/ml/modeling/linear_model/logistic_regression.py +1 -1
  120. snowflake/ml/modeling/linear_model/logistic_regression_cv.py +1 -1
  121. snowflake/ml/modeling/linear_model/multi_task_elastic_net.py +1 -1
  122. snowflake/ml/modeling/linear_model/multi_task_elastic_net_cv.py +1 -1
  123. snowflake/ml/modeling/linear_model/multi_task_lasso.py +1 -1
  124. snowflake/ml/modeling/linear_model/multi_task_lasso_cv.py +1 -1
  125. snowflake/ml/modeling/linear_model/orthogonal_matching_pursuit.py +1 -1
  126. snowflake/ml/modeling/linear_model/passive_aggressive_classifier.py +1 -1
  127. snowflake/ml/modeling/linear_model/passive_aggressive_regressor.py +1 -1
  128. snowflake/ml/modeling/linear_model/perceptron.py +1 -1
  129. snowflake/ml/modeling/linear_model/poisson_regressor.py +1 -1
  130. snowflake/ml/modeling/linear_model/ransac_regressor.py +1 -1
  131. snowflake/ml/modeling/linear_model/ridge.py +1 -1
  132. snowflake/ml/modeling/linear_model/ridge_classifier.py +1 -1
  133. snowflake/ml/modeling/linear_model/ridge_classifier_cv.py +1 -1
  134. snowflake/ml/modeling/linear_model/ridge_cv.py +1 -1
  135. snowflake/ml/modeling/linear_model/sgd_classifier.py +1 -1
  136. snowflake/ml/modeling/linear_model/sgd_one_class_svm.py +1 -1
  137. snowflake/ml/modeling/linear_model/sgd_regressor.py +1 -1
  138. snowflake/ml/modeling/linear_model/theil_sen_regressor.py +1 -1
  139. snowflake/ml/modeling/linear_model/tweedie_regressor.py +1 -1
  140. snowflake/ml/modeling/manifold/isomap.py +1 -1
  141. snowflake/ml/modeling/manifold/mds.py +1 -1
  142. snowflake/ml/modeling/manifold/spectral_embedding.py +1 -1
  143. snowflake/ml/modeling/manifold/tsne.py +1 -1
  144. snowflake/ml/modeling/mixture/bayesian_gaussian_mixture.py +1 -1
  145. snowflake/ml/modeling/mixture/gaussian_mixture.py +1 -1
  146. snowflake/ml/modeling/multiclass/one_vs_one_classifier.py +1 -1
  147. snowflake/ml/modeling/multiclass/one_vs_rest_classifier.py +1 -1
  148. snowflake/ml/modeling/multiclass/output_code_classifier.py +1 -1
  149. snowflake/ml/modeling/naive_bayes/bernoulli_nb.py +1 -1
  150. snowflake/ml/modeling/naive_bayes/categorical_nb.py +1 -1
  151. snowflake/ml/modeling/naive_bayes/complement_nb.py +1 -1
  152. snowflake/ml/modeling/naive_bayes/gaussian_nb.py +1 -1
  153. snowflake/ml/modeling/naive_bayes/multinomial_nb.py +1 -1
  154. snowflake/ml/modeling/neighbors/k_neighbors_classifier.py +1 -1
  155. snowflake/ml/modeling/neighbors/k_neighbors_regressor.py +1 -1
  156. snowflake/ml/modeling/neighbors/kernel_density.py +1 -1
  157. snowflake/ml/modeling/neighbors/local_outlier_factor.py +1 -1
  158. snowflake/ml/modeling/neighbors/nearest_centroid.py +1 -1
  159. snowflake/ml/modeling/neighbors/nearest_neighbors.py +1 -1
  160. snowflake/ml/modeling/neighbors/neighborhood_components_analysis.py +1 -1
  161. snowflake/ml/modeling/neighbors/radius_neighbors_classifier.py +1 -1
  162. snowflake/ml/modeling/neighbors/radius_neighbors_regressor.py +1 -1
  163. snowflake/ml/modeling/neural_network/bernoulli_rbm.py +1 -1
  164. snowflake/ml/modeling/neural_network/mlp_classifier.py +1 -1
  165. snowflake/ml/modeling/neural_network/mlp_regressor.py +1 -1
  166. snowflake/ml/modeling/preprocessing/polynomial_features.py +1 -1
  167. snowflake/ml/modeling/semi_supervised/label_propagation.py +1 -1
  168. snowflake/ml/modeling/semi_supervised/label_spreading.py +1 -1
  169. snowflake/ml/modeling/svm/linear_svc.py +1 -1
  170. snowflake/ml/modeling/svm/linear_svr.py +1 -1
  171. snowflake/ml/modeling/svm/nu_svc.py +1 -1
  172. snowflake/ml/modeling/svm/nu_svr.py +1 -1
  173. snowflake/ml/modeling/svm/svc.py +1 -1
  174. snowflake/ml/modeling/svm/svr.py +1 -1
  175. snowflake/ml/modeling/tree/decision_tree_classifier.py +1 -1
  176. snowflake/ml/modeling/tree/decision_tree_regressor.py +1 -1
  177. snowflake/ml/modeling/tree/extra_tree_classifier.py +1 -1
  178. snowflake/ml/modeling/tree/extra_tree_regressor.py +1 -1
  179. snowflake/ml/modeling/xgboost/xgb_classifier.py +1 -1
  180. snowflake/ml/modeling/xgboost/xgb_regressor.py +1 -1
  181. snowflake/ml/modeling/xgboost/xgbrf_classifier.py +1 -1
  182. snowflake/ml/modeling/xgboost/xgbrf_regressor.py +1 -1
  183. snowflake/ml/registry/_manager/model_manager.py +2 -1
  184. snowflake/ml/registry/_manager/model_parameter_reconciler.py +29 -2
  185. snowflake/ml/registry/registry.py +15 -0
  186. snowflake/ml/utils/authentication.py +16 -0
  187. snowflake/ml/utils/connection_params.py +5 -3
  188. snowflake/ml/version.py +1 -1
  189. {snowflake_ml_python-1.14.0.dist-info → snowflake_ml_python-1.16.0.dist-info}/METADATA +81 -36
  190. {snowflake_ml_python-1.14.0.dist-info → snowflake_ml_python-1.16.0.dist-info}/RECORD +193 -191
  191. {snowflake_ml_python-1.14.0.dist-info → snowflake_ml_python-1.16.0.dist-info}/WHEEL +0 -0
  192. {snowflake_ml_python-1.14.0.dist-info → snowflake_ml_python-1.16.0.dist-info}/licenses/LICENSE.txt +0 -0
  193. {snowflake_ml_python-1.14.0.dist-info → snowflake_ml_python-1.16.0.dist-info}/top_level.txt +0 -0
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -60,7 +60,7 @@ DATAFRAME_TYPE = Union[DataFrame, pd.DataFrame]
60
60
 
61
61
  INFER_SIGNATURE_MAX_ROWS = 100
62
62
 
63
- SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.7')
63
+ SKLEARN_LOWER, SKLEARN_UPPER = ('1.4', '1.8')
64
64
  # Modeling library estimators require a smaller sklearn version range.
65
65
  if not version.Version(SKLEARN_LOWER) <= version.Version(sklearn.__version__) < version.Version(SKLEARN_UPPER):
66
66
  raise Exception(
@@ -1,8 +1,8 @@
1
+ import logging
1
2
  from types import ModuleType
2
3
  from typing import TYPE_CHECKING, Any, Optional, Union
3
4
 
4
5
  import pandas as pd
5
- from absl.logging import logging
6
6
 
7
7
  from snowflake.ml._internal import platform_capabilities, telemetry
8
8
  from snowflake.ml._internal.exceptions import error_codes, exceptions
@@ -221,6 +221,7 @@ class ModelManager:
221
221
  )
222
222
 
223
223
  reconciler = model_parameter_reconciler.ModelParameterReconciler(
224
+ model=model,
224
225
  session=self._model_ops._session,
225
226
  database_name=self._database_name,
226
227
  schema_name=self._schema_name,
@@ -1,8 +1,8 @@
1
+ import logging
1
2
  import warnings
2
3
  from dataclasses import dataclass
3
4
  from typing import Any, Optional
4
5
 
5
- from absl.logging import logging
6
6
  from packaging import requirements
7
7
 
8
8
  from snowflake.ml import version as snowml_version
@@ -11,6 +11,7 @@ from snowflake.ml._internal.exceptions import error_codes, exceptions
11
11
  from snowflake.ml._internal.utils import sql_identifier
12
12
  from snowflake.ml.model import target_platform, type_hints as model_types
13
13
  from snowflake.ml.model._model_composer.model_manifest import model_manifest_schema
14
+ from snowflake.ml.model.volatility import DEFAULT_VOLATILITY_BY_MODEL_TYPE, Volatility
14
15
  from snowflake.snowpark import Session
15
16
  from snowflake.snowpark._internal import utils as snowpark_utils
16
17
 
@@ -34,6 +35,7 @@ class ModelParameterReconciler:
34
35
 
35
36
  def __init__(
36
37
  self,
38
+ model: model_types.SupportedModelType,
37
39
  session: Session,
38
40
  database_name: sql_identifier.SqlIdentifier,
39
41
  schema_name: sql_identifier.SqlIdentifier,
@@ -45,6 +47,7 @@ class ModelParameterReconciler:
45
47
  python_version: Optional[str] = None,
46
48
  statement_params: Optional[dict[str, str]] = None,
47
49
  ) -> None:
50
+ self._model = model
48
51
  self._session = session
49
52
  self._database_name = database_name
50
53
  self._schema_name = schema_name
@@ -67,6 +70,7 @@ class ModelParameterReconciler:
67
70
  reconciled_target_platforms = self._reconcile_target_platforms()
68
71
  reconciled_options = self._reconcile_explainability_options(reconciled_target_platforms)
69
72
  reconciled_options = self._reconcile_relax_version(reconciled_options, reconciled_target_platforms)
73
+ reconciled_options = self._reconcile_volatility_defaults(reconciled_options) # ADD THIS LINE
70
74
 
71
75
  return ReconciledParameters(
72
76
  conda_dependencies=self._conda_dependencies,
@@ -221,7 +225,7 @@ class ModelParameterReconciler:
221
225
  ).get(env_utils.SNOWPARK_ML_PKG_NAME, [])
222
226
 
223
227
  if len(snowml_matched_versions) < 1 and not options.get("embed_local_ml_library", False):
224
- logging.info(
228
+ logger.info(
225
229
  f"Local snowflake-ml-python library has version {snowml_version.VERSION},"
226
230
  " which is not available in the Snowflake server, embedding local ML library automatically."
227
231
  )
@@ -292,3 +296,26 @@ class ModelParameterReconciler:
292
296
  )
293
297
 
294
298
  return options
299
+
300
+ def _get_default_volatility_for_model(self, model: model_types.SupportedModelType) -> Volatility:
301
+ """Get default volatility for a model based on its type."""
302
+ from snowflake.ml.model._packager import model_handler
303
+
304
+ handler = model_handler.find_handler(model)
305
+ # default to IMMUTABLE if no handler found or handler type not in defaults
306
+ if not handler or handler.HANDLER_TYPE not in DEFAULT_VOLATILITY_BY_MODEL_TYPE:
307
+ return Volatility.IMMUTABLE
308
+ return DEFAULT_VOLATILITY_BY_MODEL_TYPE[handler.HANDLER_TYPE]
309
+
310
+ def _reconcile_volatility_defaults(self, options: model_types.ModelSaveOption) -> model_types.ModelSaveOption:
311
+ """Set global default volatility based on model type."""
312
+
313
+ # Skip if default_volatility is already explicitly set
314
+ if "volatility" in options:
315
+ return options
316
+
317
+ # Get default volatility for this model type
318
+ default_volatility = self._get_default_volatility_for_model(self._model)
319
+ options["volatility"] = default_volatility
320
+
321
+ return options
@@ -235,6 +235,10 @@ class Registry:
235
235
  - max_batch_size: Maximum batch size that the method could accept in the Snowflake Warehouse.
236
236
  Defaults to None, determined automatically by Snowflake.
237
237
  - function_type: One of supported model method function types (FUNCTION or TABLE_FUNCTION).
238
+ - volatility: Volatility level for the function (use Volatility.VOLATILE or Volatility.IMMUTABLE).
239
+ Volatility.VOLATILE functions may return different results for the same arguments, while
240
+ Volatility.IMMUTABLE functions always return the same result for the same arguments.
241
+ Defaults to None (no volatility specified).
238
242
  Returns:
239
243
  ModelVersion: ModelVersion object corresponding to the model just logged.
240
244
  """
@@ -366,6 +370,12 @@ class Registry:
366
370
  Warehouse. It detects any ==x.y.z in specifiers and replaced with >=x.y, <(x+1). Defaults to True.
367
371
  - function_type: Set the method function type globally. To set method function types individually see
368
372
  function_type in model_options.
373
+ - volatility: Set the volatility for all model methods globally (use Volatility.VOLATILE or
374
+ Volatility.IMMUTABLE). Volatility.VOLATILE functions may return different results for the same
375
+ arguments, while Volatility.IMMUTABLE functions always return the same result for the same arguments.
376
+ Defaults are set automatically based on model type: supported models (sklearn, xgboost, pytorch,
377
+ huggingface_pipeline, mlflow, etc.) default to IMMUTABLE, while custom models default to VOLATILE.
378
+ Individual method volatility can be set in method_options and will override this global setting.
369
379
  - target_methods: List of target methods to register when logging the model.
370
380
  This option is not used in MLFlow models. Defaults to None, in which case the model handler's
371
381
  default target methods will be used.
@@ -382,6 +392,11 @@ class Registry:
382
392
  - max_batch_size: Maximum batch size that the method could accept in the Snowflake Warehouse.
383
393
  Defaults to None, determined automatically by Snowflake.
384
394
  - function_type: One of supported model method function types (FUNCTION or TABLE_FUNCTION).
395
+ - volatility: Volatility level for the function (use Volatility.VOLATILE or Volatility.IMMUTABLE).
396
+ Volatility.VOLATILE functions may return different results for the same arguments, while
397
+ Volatility.IMMUTABLE functions always return the same result for the same arguments.
398
+ This per-method setting overrides any global volatility setting.
399
+ Defaults to None (no volatility specified).
385
400
 
386
401
  Raises:
387
402
  ValueError: If extra arguments are specified ModelVersion is provided.
@@ -73,3 +73,19 @@ class SnowflakeJWTTokenAuth(auth.AuthBase):
73
73
  def __call__(self, r: requests.PreparedRequest) -> requests.PreparedRequest:
74
74
  r.headers["Authorization"] = f'Snowflake Token="{self.snowflake_token}"'
75
75
  return r
76
+
77
+
78
+ class SnowflakePATAuth(auth.AuthBase):
79
+ """Authentication using Snowflake Programmatic Access Token (PAT)."""
80
+
81
+ def __init__(self, pat_token: str) -> None:
82
+ """Initialize with a PAT token.
83
+
84
+ Args:
85
+ pat_token: The programmatic access token string
86
+ """
87
+ self.pat_token = pat_token
88
+
89
+ def __call__(self, r: requests.PreparedRequest) -> requests.PreparedRequest:
90
+ r.headers["Authorization"] = f'Snowflake Token="{self.pat_token}"'
91
+ return r
@@ -1,13 +1,15 @@
1
1
  import configparser
2
+ import logging
2
3
  import os
3
4
  from typing import Optional, Union
4
5
 
5
- from absl import logging
6
6
  from cryptography.hazmat import backends
7
7
  from cryptography.hazmat.primitives import serialization
8
8
 
9
9
  from snowflake import snowpark
10
10
 
11
+ logger = logging.getLogger(__name__)
12
+
11
13
  _DEFAULT_CONNECTION_FILE = "~/.snowsql/config"
12
14
 
13
15
 
@@ -108,7 +110,7 @@ def _load_from_snowsql_config_file(connection_name: str, login_file: str = "") -
108
110
  """Loads the dictionary from snowsql config file."""
109
111
  snowsql_config_file = login_file if login_file else os.path.expanduser(_DEFAULT_CONNECTION_FILE)
110
112
  if not os.path.exists(snowsql_config_file):
111
- logging.error(f"Connection name given but snowsql config file is not found at: {snowsql_config_file}")
113
+ logger.error(f"Connection name given but snowsql config file is not found at: {snowsql_config_file}")
112
114
  raise Exception("Snowflake SnowSQL config not found.")
113
115
 
114
116
  config = configparser.ConfigParser(inline_comment_prefixes="#")
@@ -124,7 +126,7 @@ def _load_from_snowsql_config_file(connection_name: str, login_file: str = "") -
124
126
  # See https://docs.snowflake.com/en/user-guide/snowsql-start.html#configuring-default-connection-settings
125
127
  connection_name = "connections"
126
128
 
127
- logging.info(f"Reading {snowsql_config_file} for connection parameters defined as {connection_name}")
129
+ logger.info(f"Reading {snowsql_config_file} for connection parameters defined as {connection_name}")
128
130
  config.read(snowsql_config_file)
129
131
  conn_params = dict(config[connection_name])
130
132
  # Remap names to appropriate args in Python Connector API
snowflake/ml/version.py CHANGED
@@ -1,2 +1,2 @@
1
1
  # This is parsed by regex in conda recipe meta file. Make sure not to break it.
2
- VERSION = "1.14.0"
2
+ VERSION = "1.16.0"