snowflake-ml-python 1.20.0__py3-none-any.whl → 1.22.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 (68) hide show
  1. snowflake/ml/_internal/platform_capabilities.py +36 -0
  2. snowflake/ml/_internal/utils/url.py +42 -0
  3. snowflake/ml/data/_internal/arrow_ingestor.py +67 -2
  4. snowflake/ml/data/data_connector.py +103 -1
  5. snowflake/ml/experiment/_client/experiment_tracking_sql_client.py +8 -2
  6. snowflake/ml/experiment/callback/__init__.py +0 -0
  7. snowflake/ml/experiment/callback/keras.py +25 -2
  8. snowflake/ml/experiment/callback/lightgbm.py +27 -2
  9. snowflake/ml/experiment/callback/xgboost.py +25 -2
  10. snowflake/ml/experiment/experiment_tracking.py +93 -3
  11. snowflake/ml/experiment/utils.py +6 -0
  12. snowflake/ml/feature_store/feature_view.py +34 -24
  13. snowflake/ml/jobs/_interop/protocols.py +3 -0
  14. snowflake/ml/jobs/_utils/constants.py +1 -0
  15. snowflake/ml/jobs/_utils/payload_utils.py +354 -356
  16. snowflake/ml/jobs/_utils/scripts/mljob_launcher.py +95 -8
  17. snowflake/ml/jobs/_utils/scripts/start_mlruntime.sh +92 -0
  18. snowflake/ml/jobs/_utils/scripts/startup.sh +112 -0
  19. snowflake/ml/jobs/_utils/spec_utils.py +1 -445
  20. snowflake/ml/jobs/_utils/stage_utils.py +22 -1
  21. snowflake/ml/jobs/_utils/types.py +14 -7
  22. snowflake/ml/jobs/job.py +2 -8
  23. snowflake/ml/jobs/manager.py +57 -135
  24. snowflake/ml/lineage/lineage_node.py +1 -1
  25. snowflake/ml/model/__init__.py +6 -0
  26. snowflake/ml/model/_client/model/batch_inference_specs.py +16 -1
  27. snowflake/ml/model/_client/model/model_version_impl.py +130 -14
  28. snowflake/ml/model/_client/ops/deployment_step.py +36 -0
  29. snowflake/ml/model/_client/ops/model_ops.py +93 -8
  30. snowflake/ml/model/_client/ops/service_ops.py +32 -52
  31. snowflake/ml/model/_client/service/import_model_spec_schema.py +23 -0
  32. snowflake/ml/model/_client/service/model_deployment_spec.py +12 -4
  33. snowflake/ml/model/_client/service/model_deployment_spec_schema.py +3 -0
  34. snowflake/ml/model/_client/sql/model_version.py +30 -6
  35. snowflake/ml/model/_client/sql/service.py +94 -5
  36. snowflake/ml/model/_model_composer/model_composer.py +1 -1
  37. snowflake/ml/model/_model_composer/model_manifest/model_manifest_schema.py +5 -0
  38. snowflake/ml/model/_model_composer/model_method/model_method.py +61 -2
  39. snowflake/ml/model/_packager/model_handler.py +8 -2
  40. snowflake/ml/model/_packager/model_handlers/custom.py +52 -0
  41. snowflake/ml/model/_packager/model_handlers/{huggingface_pipeline.py → huggingface.py} +203 -76
  42. snowflake/ml/model/_packager/model_handlers/mlflow.py +6 -1
  43. snowflake/ml/model/_packager/model_handlers/xgboost.py +26 -1
  44. snowflake/ml/model/_packager/model_meta/model_meta.py +40 -7
  45. snowflake/ml/model/_packager/model_packager.py +1 -1
  46. snowflake/ml/model/_signatures/core.py +390 -8
  47. snowflake/ml/model/_signatures/utils.py +13 -4
  48. snowflake/ml/model/code_path.py +104 -0
  49. snowflake/ml/model/compute_pool.py +2 -0
  50. snowflake/ml/model/custom_model.py +55 -13
  51. snowflake/ml/model/model_signature.py +13 -1
  52. snowflake/ml/model/models/huggingface.py +285 -0
  53. snowflake/ml/model/models/huggingface_pipeline.py +19 -208
  54. snowflake/ml/model/type_hints.py +7 -1
  55. snowflake/ml/modeling/_internal/snowpark_implementations/distributed_hpo_trainer.py +2 -2
  56. snowflake/ml/monitoring/_client/model_monitor_sql_client.py +12 -0
  57. snowflake/ml/monitoring/_manager/model_monitor_manager.py +12 -0
  58. snowflake/ml/monitoring/entities/model_monitor_config.py +5 -0
  59. snowflake/ml/registry/_manager/model_manager.py +230 -15
  60. snowflake/ml/registry/registry.py +4 -4
  61. snowflake/ml/utils/html_utils.py +67 -1
  62. snowflake/ml/version.py +1 -1
  63. {snowflake_ml_python-1.20.0.dist-info → snowflake_ml_python-1.22.0.dist-info}/METADATA +81 -7
  64. {snowflake_ml_python-1.20.0.dist-info → snowflake_ml_python-1.22.0.dist-info}/RECORD +67 -59
  65. snowflake/ml/jobs/_utils/runtime_env_utils.py +0 -63
  66. {snowflake_ml_python-1.20.0.dist-info → snowflake_ml_python-1.22.0.dist-info}/WHEEL +0 -0
  67. {snowflake_ml_python-1.20.0.dist-info → snowflake_ml_python-1.22.0.dist-info}/licenses/LICENSE.txt +0 -0
  68. {snowflake_ml_python-1.20.0.dist-info → snowflake_ml_python-1.22.0.dist-info}/top_level.txt +0 -0
@@ -218,38 +218,48 @@ class FeatureView(lineage_node.LineageNode):
218
218
  """
219
219
  Create a FeatureView instance.
220
220
 
221
+ # noqa: DAR101
222
+
221
223
  Args:
222
- name: name of the FeatureView. NOTE: following Snowflake identifier rule
223
- entities: entities that the FeatureView is associated with.
224
- feature_df: Snowpark DataFrame containing data source and all feature feature_df logics.
225
- Final projection of the DataFrame should contain feature names, join keys and timestamp(if applicable).
224
+ name: The name of the FeatureView. This must follow Snowflake identifier rules.
225
+ entities: The entities that the FeatureView is associated with.
226
+ feature_df: The Snowpark DataFrame containing data source and all feature feature_df logic.
227
+ The final projection of the DataFrame should contain feature names, join keys and timestamp if
228
+ applicable.
226
229
  timestamp_col: name of the timestamp column for point-in-time lookup when consuming the
227
230
  feature values.
228
- refresh_freq: Time unit defining how often the new feature data should be generated.
229
- Valid args are { <num> { seconds | minutes | hours | days } | DOWNSTREAM | <cron expr> <time zone>}.
230
- NOTE: Currently minimum refresh frequency is 1 minute.
231
- NOTE: If refresh_freq is in cron expression format, there must be a valid time zone as well.
232
- E.g. * * * * * UTC
233
- NOTE: If refresh_freq is not provided, then FeatureView will be registered as View on Snowflake backend
234
- and there won't be extra storage cost.
235
- desc: description of the FeatureView.
236
- warehouse: warehouse to refresh feature view. Not needed for static feature view (refresh_freq is None).
237
- For managed feature view, this warehouse will overwrite the default warehouse of Feature Store if it is
238
- specified, otherwise the default warehouse will be used.
231
+ refresh_freq: Time unit defining how often the new feature data should be generated, in the format
232
+ ``{ <num> { seconds | minutes | hours | days } | DOWNSTREAM | <cron expr> <time zone>}``.
233
+
234
+ The minimum refresh frequency is 1 minute.
235
+
236
+ When using a ``cron`` format, you must provide a time zone.
237
+
238
+ When you don't provide a refresh value, the ``FeatureView`` is registered as a ``View`` on the Snowflake
239
+ backend. There are no extra storage costs incurred for this view.
240
+ desc: Description of the FeatureView.
241
+ warehouse: The warehouse used to refresh this feature view. Not needed when ``refresh_freq`` is ``None``.
242
+ This warehouse will overwrite the default warehouse of Feature Store if specified, otherwise the default
243
+ warehouse will be used.
239
244
  initialize: Specifies the behavior of the initial refresh of feature view. This property cannot be altered
240
245
  after you register the feature view. It supports ON_CREATE (default) or ON_SCHEDULE. ON_CREATE refreshes
241
246
  the feature view synchronously at creation. ON_SCHEDULE refreshes the feature view at the next scheduled
242
247
  refresh. It is only effective when refresh_freq is not None.
243
248
  refresh_mode: The refresh mode of managed feature view. The value can be 'AUTO', 'FULL' or 'INCREMENTAL'.
244
- For managed feature view, the default value is 'AUTO'. For static feature view it has no effect.
245
- Check https://docs.snowflake.com/en/sql-reference/sql/create-dynamic-table for for details.
246
- cluster_by: Columns to cluster the feature view by.
247
- - Defaults to the join keys from entities.
248
- - If `timestamp_col` is provided, it is added to the default clustering keys.
249
- online_config: Optional configuration for online storage. If provided with enable=True,
250
- online storage will be enabled. Defaults to None (no online storage).
251
- NOTE: this feature is currently in Public Preview.
252
- _kwargs: reserved kwargs for system generated args. NOTE: DO NOT USE.
249
+ For managed feature view, the default value is 'AUTO'. For static feature view it has no effect. For
250
+ more information, see
251
+ `CREATE DYNAMIC TABLE <https://docs.snowflake.com/en/sql-reference/sql/create-dynamic-table>`__.
252
+ cluster_by: Columns to cluster the feature view by. If ``timestamp_col`` is provided, it is added to the
253
+ default clustering keys. Default is to use the join keys from entities in the view.
254
+ online_config: Configuration for online storage. If provided with ``enable=True``,
255
+ online storage will be enabled. Defaults to ``None`` (no online storage).
256
+
257
+ .. note::
258
+ This feature is currently in preview.
259
+ _kwargs: Reserved kwargs for system generated args.
260
+
261
+ .. caution::
262
+ Use of additional keywords is prohibited.
253
263
 
254
264
  Example::
255
265
 
@@ -266,6 +266,9 @@ class PandasDataFrameProtocol(SerializationProtocol):
266
266
 
267
267
  # TODO: Support partitioned writes for large datasets
268
268
  result_path = posixpath.join(dest_dir, self.DEFAULT_PATH_PATTERN.format(0))
269
+ # stage mount v2 has a bug where it creates an empty file when creating a new file
270
+ with data_utils.open_stream(result_path, "wb", session=session) as stream:
271
+ stream.write(b"") # Dummy write to create the file
269
272
  with data_utils.open_stream(result_path, "wb", session=session) as stream:
270
273
  obj.to_parquet(stream)
271
274
 
@@ -30,6 +30,7 @@ DEFAULT_IMAGE_CPU = "st_plat/runtime/x86/runtime_image/snowbooks"
30
30
  DEFAULT_IMAGE_GPU = "st_plat/runtime/x86/generic_gpu/runtime_image/snowbooks"
31
31
  DEFAULT_IMAGE_TAG = "1.8.0"
32
32
  DEFAULT_ENTRYPOINT_PATH = "func.py"
33
+ DEFAULT_PYTHON_VERSION = "3.10"
33
34
 
34
35
  # Percent of container memory to allocate for /dev/shm volume
35
36
  MEMORY_VOLUME_SIZE = 0.3