snowflake-ml-python 1.9.0__py3-none-any.whl → 1.9.2__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 (62) hide show
  1. snowflake/ml/_internal/env_utils.py +44 -3
  2. snowflake/ml/_internal/platform_capabilities.py +52 -2
  3. snowflake/ml/_internal/type_utils.py +1 -1
  4. snowflake/ml/_internal/utils/mixins.py +54 -42
  5. snowflake/ml/_internal/utils/service_logger.py +105 -3
  6. snowflake/ml/data/_internal/arrow_ingestor.py +15 -2
  7. snowflake/ml/data/data_connector.py +13 -2
  8. snowflake/ml/data/data_ingestor.py +8 -0
  9. snowflake/ml/data/torch_utils.py +1 -1
  10. snowflake/ml/dataset/dataset.py +2 -1
  11. snowflake/ml/dataset/dataset_reader.py +14 -4
  12. snowflake/ml/experiment/__init__.py +3 -0
  13. snowflake/ml/experiment/_client/experiment_tracking_sql_client.py +98 -0
  14. snowflake/ml/experiment/_entities/__init__.py +4 -0
  15. snowflake/ml/experiment/_entities/experiment.py +10 -0
  16. snowflake/ml/experiment/_entities/run.py +62 -0
  17. snowflake/ml/experiment/_entities/run_metadata.py +68 -0
  18. snowflake/ml/experiment/_experiment_info.py +63 -0
  19. snowflake/ml/experiment/callback.py +121 -0
  20. snowflake/ml/experiment/experiment_tracking.py +319 -0
  21. snowflake/ml/jobs/_utils/constants.py +15 -4
  22. snowflake/ml/jobs/_utils/payload_utils.py +156 -54
  23. snowflake/ml/jobs/_utils/query_helper.py +16 -5
  24. snowflake/ml/jobs/_utils/scripts/constants.py +0 -22
  25. snowflake/ml/jobs/_utils/scripts/mljob_launcher.py +130 -23
  26. snowflake/ml/jobs/_utils/spec_utils.py +23 -8
  27. snowflake/ml/jobs/_utils/stage_utils.py +30 -14
  28. snowflake/ml/jobs/_utils/types.py +64 -4
  29. snowflake/ml/jobs/job.py +70 -75
  30. snowflake/ml/jobs/manager.py +59 -31
  31. snowflake/ml/lineage/lineage_node.py +2 -2
  32. snowflake/ml/model/_client/model/model_version_impl.py +16 -4
  33. snowflake/ml/model/_client/ops/service_ops.py +336 -137
  34. snowflake/ml/model/_client/service/model_deployment_spec.py +1 -1
  35. snowflake/ml/model/_client/service/model_deployment_spec_schema.py +1 -1
  36. snowflake/ml/model/_client/sql/service.py +1 -38
  37. snowflake/ml/model/_model_composer/model_composer.py +6 -1
  38. snowflake/ml/model/_model_composer/model_manifest/model_manifest.py +17 -3
  39. snowflake/ml/model/_model_composer/model_manifest/model_manifest_schema.py +1 -0
  40. snowflake/ml/model/_packager/model_handlers/huggingface_pipeline.py +41 -2
  41. snowflake/ml/model/_packager/model_handlers/sklearn.py +9 -5
  42. snowflake/ml/model/_packager/model_runtime/_snowml_inference_alternative_requirements.py +3 -1
  43. snowflake/ml/model/_packager/model_runtime/model_runtime.py +3 -3
  44. snowflake/ml/model/_signatures/pandas_handler.py +3 -0
  45. snowflake/ml/model/_signatures/utils.py +4 -0
  46. snowflake/ml/model/event_handler.py +117 -0
  47. snowflake/ml/model/model_signature.py +11 -9
  48. snowflake/ml/model/models/huggingface_pipeline.py +170 -1
  49. snowflake/ml/modeling/framework/base.py +1 -1
  50. snowflake/ml/modeling/metrics/classification.py +14 -14
  51. snowflake/ml/modeling/metrics/correlation.py +19 -8
  52. snowflake/ml/modeling/metrics/ranking.py +6 -6
  53. snowflake/ml/modeling/metrics/regression.py +9 -9
  54. snowflake/ml/monitoring/explain_visualize.py +12 -5
  55. snowflake/ml/registry/_manager/model_manager.py +32 -15
  56. snowflake/ml/registry/registry.py +48 -80
  57. snowflake/ml/version.py +1 -1
  58. {snowflake_ml_python-1.9.0.dist-info → snowflake_ml_python-1.9.2.dist-info}/METADATA +107 -5
  59. {snowflake_ml_python-1.9.0.dist-info → snowflake_ml_python-1.9.2.dist-info}/RECORD +62 -52
  60. {snowflake_ml_python-1.9.0.dist-info → snowflake_ml_python-1.9.2.dist-info}/WHEEL +0 -0
  61. {snowflake_ml_python-1.9.0.dist-info → snowflake_ml_python-1.9.2.dist-info}/licenses/LICENSE.txt +0 -0
  62. {snowflake_ml_python-1.9.0.dist-info → snowflake_ml_python-1.9.2.dist-info}/top_level.txt +0 -0
@@ -4,7 +4,7 @@ from typing import TYPE_CHECKING, Literal, Optional, Union
4
4
 
5
5
  from snowflake import snowpark
6
6
  from snowflake.ml._internal import telemetry
7
- from snowflake.ml._internal.utils import identifier
7
+ from snowflake.ml._internal.utils import identifier, mixins
8
8
 
9
9
  if TYPE_CHECKING:
10
10
  from snowflake.ml import dataset
@@ -15,7 +15,7 @@ _PROJECT = "LINEAGE"
15
15
  DOMAIN_LINEAGE_REGISTRY: dict[str, type["LineageNode"]] = {}
16
16
 
17
17
 
18
- class LineageNode:
18
+ class LineageNode(mixins.SerializableSessionMixin):
19
19
  """
20
20
  Represents a node in a lineage graph and serves as the base class for all machine learning objects.
21
21
  """
@@ -1,4 +1,5 @@
1
1
  import enum
2
+ import logging
2
3
  import pathlib
3
4
  import tempfile
4
5
  import warnings
@@ -10,7 +11,7 @@ from snowflake import snowpark
10
11
  from snowflake.ml._internal import telemetry
11
12
  from snowflake.ml._internal.utils import sql_identifier
12
13
  from snowflake.ml.lineage import lineage_node
13
- from snowflake.ml.model import type_hints as model_types
14
+ from snowflake.ml.model import task, type_hints
14
15
  from snowflake.ml.model._client.ops import metadata_ops, model_ops, service_ops
15
16
  from snowflake.ml.model._model_composer import model_composer
16
17
  from snowflake.ml.model._model_composer.model_manifest import model_manifest_schema
@@ -401,7 +402,7 @@ class ModelVersion(lineage_node.LineageNode):
401
402
  project=_TELEMETRY_PROJECT,
402
403
  subproject=_TELEMETRY_SUBPROJECT,
403
404
  )
404
- def get_model_task(self) -> model_types.Task:
405
+ def get_model_task(self) -> task.Task:
405
406
  statement_params = telemetry.get_statement_params(
406
407
  project=_TELEMETRY_PROJECT,
407
408
  subproject=_TELEMETRY_SUBPROJECT,
@@ -607,8 +608,8 @@ class ModelVersion(lineage_node.LineageNode):
607
608
  self,
608
609
  *,
609
610
  force: bool = False,
610
- options: Optional[model_types.ModelLoadOption] = None,
611
- ) -> model_types.SupportedModelType:
611
+ options: Optional[type_hints.ModelLoadOption] = None,
612
+ ) -> type_hints.SupportedModelType:
612
613
  """Load the underlying original Python object back from a model.
613
614
  This operation requires to have the exact the same environment as the one when logging the model, otherwise,
614
615
  the model might be not functional or some other problems might occur.
@@ -889,6 +890,17 @@ class ModelVersion(lineage_node.LineageNode):
889
890
  project=_TELEMETRY_PROJECT,
890
891
  subproject=_TELEMETRY_SUBPROJECT,
891
892
  )
893
+
894
+ # Check root logger level and emit warning if needed
895
+ root_logger = logging.getLogger()
896
+ if root_logger.level in (logging.WARNING, logging.ERROR):
897
+ warnings.warn(
898
+ "Suppressing service logs. Set the log level to INFO if you would like "
899
+ "verbose service logs (e.g., logging.getLogger().setLevel(logging.INFO)).",
900
+ UserWarning,
901
+ stacklevel=2,
902
+ )
903
+
892
904
  if build_external_access_integration is not None:
893
905
  msg = (
894
906
  "`build_external_access_integration` is deprecated. "