snowflake-ml-python 1.4.1__py3-none-any.whl → 1.5.1__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.
- snowflake/ml/_internal/env_utils.py +72 -31
- snowflake/ml/_internal/exceptions/dataset_error_messages.py +5 -0
- snowflake/ml/_internal/exceptions/dataset_errors.py +24 -0
- snowflake/ml/_internal/exceptions/error_codes.py +3 -0
- snowflake/ml/_internal/lineage/data_source.py +10 -0
- snowflake/ml/_internal/lineage/lineage_utils.py +95 -0
- snowflake/ml/_internal/telemetry.py +1 -0
- snowflake/ml/_internal/utils/identifier.py +1 -1
- snowflake/ml/_internal/utils/sql_identifier.py +14 -1
- snowflake/ml/dataset/__init__.py +11 -0
- snowflake/ml/dataset/dataset.py +455 -129
- snowflake/ml/dataset/dataset_factory.py +53 -0
- snowflake/ml/dataset/dataset_metadata.py +103 -0
- snowflake/ml/dataset/dataset_reader.py +199 -0
- snowflake/ml/feature_store/__init__.py +6 -0
- snowflake/ml/feature_store/access_manager.py +279 -0
- snowflake/ml/feature_store/feature_store.py +544 -358
- snowflake/ml/feature_store/feature_view.py +55 -16
- snowflake/ml/fileset/embedded_stage_fs.py +149 -0
- snowflake/ml/fileset/sfcfs.py +0 -4
- snowflake/ml/fileset/snowfs.py +160 -0
- snowflake/ml/fileset/stage_fs.py +25 -10
- snowflake/ml/model/__init__.py +2 -2
- snowflake/ml/model/_api.py +16 -1
- snowflake/ml/model/_client/model/model_impl.py +65 -31
- snowflake/ml/model/_client/model/model_version_impl.py +159 -2
- snowflake/ml/model/_client/ops/metadata_ops.py +27 -4
- snowflake/ml/model/_client/ops/model_ops.py +268 -83
- snowflake/ml/model/_client/sql/_base.py +34 -0
- snowflake/ml/model/_client/sql/model.py +42 -47
- snowflake/ml/model/_client/sql/model_version.py +164 -39
- snowflake/ml/model/_client/sql/stage.py +6 -32
- snowflake/ml/model/_client/sql/tag.py +32 -56
- snowflake/ml/model/_deploy_client/image_builds/server_image_builder.py +5 -1
- snowflake/ml/model/_deploy_client/image_builds/templates/dockerfile_template +1 -0
- snowflake/ml/model/_deploy_client/snowservice/deploy.py +2 -0
- snowflake/ml/model/_deploy_client/utils/constants.py +0 -5
- snowflake/ml/model/_deploy_client/utils/snowservice_client.py +21 -50
- snowflake/ml/model/_model_composer/model_composer.py +22 -1
- snowflake/ml/model/_model_composer/model_manifest/model_manifest.py +22 -0
- snowflake/ml/model/_model_composer/model_manifest/model_manifest_schema.py +11 -0
- snowflake/ml/model/_packager/model_env/model_env.py +41 -0
- snowflake/ml/model/_packager/model_handlers/mlflow.py +2 -1
- snowflake/ml/model/_packager/model_meta/model_meta.py +1 -5
- snowflake/ml/model/_packager/model_packager.py +0 -3
- snowflake/ml/modeling/_internal/local_implementations/pandas_trainer.py +55 -3
- snowflake/ml/modeling/_internal/ml_runtime_implementations/ml_runtime_handlers.py +34 -18
- snowflake/ml/modeling/_internal/model_trainer.py +7 -0
- snowflake/ml/modeling/_internal/model_trainer_builder.py +42 -9
- snowflake/ml/modeling/_internal/snowpark_implementations/distributed_hpo_trainer.py +50 -21
- snowflake/ml/modeling/_internal/snowpark_implementations/snowpark_handlers.py +24 -2
- snowflake/ml/modeling/_internal/snowpark_implementations/snowpark_trainer.py +340 -17
- snowflake/ml/modeling/calibration/calibrated_classifier_cv.py +51 -52
- snowflake/ml/modeling/cluster/affinity_propagation.py +51 -52
- snowflake/ml/modeling/cluster/agglomerative_clustering.py +51 -52
- snowflake/ml/modeling/cluster/birch.py +53 -52
- snowflake/ml/modeling/cluster/bisecting_k_means.py +53 -52
- snowflake/ml/modeling/cluster/dbscan.py +51 -52
- snowflake/ml/modeling/cluster/feature_agglomeration.py +53 -52
- snowflake/ml/modeling/cluster/k_means.py +53 -52
- snowflake/ml/modeling/cluster/mean_shift.py +51 -52
- snowflake/ml/modeling/cluster/mini_batch_k_means.py +53 -52
- snowflake/ml/modeling/cluster/optics.py +51 -52
- snowflake/ml/modeling/cluster/spectral_biclustering.py +51 -52
- snowflake/ml/modeling/cluster/spectral_clustering.py +51 -52
- snowflake/ml/modeling/cluster/spectral_coclustering.py +51 -52
- snowflake/ml/modeling/compose/column_transformer.py +53 -52
- snowflake/ml/modeling/compose/transformed_target_regressor.py +51 -52
- snowflake/ml/modeling/covariance/elliptic_envelope.py +51 -52
- snowflake/ml/modeling/covariance/empirical_covariance.py +51 -52
- snowflake/ml/modeling/covariance/graphical_lasso.py +51 -52
- snowflake/ml/modeling/covariance/graphical_lasso_cv.py +51 -52
- snowflake/ml/modeling/covariance/ledoit_wolf.py +51 -52
- snowflake/ml/modeling/covariance/min_cov_det.py +51 -52
- snowflake/ml/modeling/covariance/oas.py +51 -52
- snowflake/ml/modeling/covariance/shrunk_covariance.py +51 -52
- snowflake/ml/modeling/decomposition/dictionary_learning.py +53 -52
- snowflake/ml/modeling/decomposition/factor_analysis.py +53 -52
- snowflake/ml/modeling/decomposition/fast_ica.py +53 -52
- snowflake/ml/modeling/decomposition/incremental_pca.py +53 -52
- snowflake/ml/modeling/decomposition/kernel_pca.py +53 -52
- snowflake/ml/modeling/decomposition/mini_batch_dictionary_learning.py +53 -52
- snowflake/ml/modeling/decomposition/mini_batch_sparse_pca.py +53 -52
- snowflake/ml/modeling/decomposition/pca.py +53 -52
- snowflake/ml/modeling/decomposition/sparse_pca.py +53 -52
- snowflake/ml/modeling/decomposition/truncated_svd.py +53 -52
- snowflake/ml/modeling/discriminant_analysis/linear_discriminant_analysis.py +53 -52
- snowflake/ml/modeling/discriminant_analysis/quadratic_discriminant_analysis.py +51 -52
- snowflake/ml/modeling/ensemble/ada_boost_classifier.py +51 -52
- snowflake/ml/modeling/ensemble/ada_boost_regressor.py +51 -52
- snowflake/ml/modeling/ensemble/bagging_classifier.py +51 -52
- snowflake/ml/modeling/ensemble/bagging_regressor.py +51 -52
- snowflake/ml/modeling/ensemble/extra_trees_classifier.py +51 -52
- snowflake/ml/modeling/ensemble/extra_trees_regressor.py +51 -52
- snowflake/ml/modeling/ensemble/gradient_boosting_classifier.py +51 -52
- snowflake/ml/modeling/ensemble/gradient_boosting_regressor.py +51 -52
- snowflake/ml/modeling/ensemble/hist_gradient_boosting_classifier.py +51 -52
- snowflake/ml/modeling/ensemble/hist_gradient_boosting_regressor.py +51 -52
- snowflake/ml/modeling/ensemble/isolation_forest.py +51 -52
- snowflake/ml/modeling/ensemble/random_forest_classifier.py +51 -52
- snowflake/ml/modeling/ensemble/random_forest_regressor.py +51 -52
- snowflake/ml/modeling/ensemble/stacking_regressor.py +53 -52
- snowflake/ml/modeling/ensemble/voting_classifier.py +53 -52
- snowflake/ml/modeling/ensemble/voting_regressor.py +53 -52
- snowflake/ml/modeling/feature_selection/generic_univariate_select.py +53 -52
- snowflake/ml/modeling/feature_selection/select_fdr.py +53 -52
- snowflake/ml/modeling/feature_selection/select_fpr.py +53 -52
- snowflake/ml/modeling/feature_selection/select_fwe.py +53 -52
- snowflake/ml/modeling/feature_selection/select_k_best.py +53 -52
- snowflake/ml/modeling/feature_selection/select_percentile.py +53 -52
- snowflake/ml/modeling/feature_selection/sequential_feature_selector.py +53 -52
- snowflake/ml/modeling/feature_selection/variance_threshold.py +53 -52
- snowflake/ml/modeling/framework/base.py +64 -36
- snowflake/ml/modeling/gaussian_process/gaussian_process_classifier.py +51 -52
- snowflake/ml/modeling/gaussian_process/gaussian_process_regressor.py +51 -52
- snowflake/ml/modeling/impute/iterative_imputer.py +53 -52
- snowflake/ml/modeling/impute/knn_imputer.py +53 -52
- snowflake/ml/modeling/impute/missing_indicator.py +53 -52
- snowflake/ml/modeling/kernel_approximation/additive_chi2_sampler.py +53 -52
- snowflake/ml/modeling/kernel_approximation/nystroem.py +53 -52
- snowflake/ml/modeling/kernel_approximation/polynomial_count_sketch.py +53 -52
- snowflake/ml/modeling/kernel_approximation/rbf_sampler.py +53 -52
- snowflake/ml/modeling/kernel_approximation/skewed_chi2_sampler.py +53 -52
- snowflake/ml/modeling/kernel_ridge/kernel_ridge.py +51 -52
- snowflake/ml/modeling/lightgbm/lgbm_classifier.py +51 -52
- snowflake/ml/modeling/lightgbm/lgbm_regressor.py +51 -52
- snowflake/ml/modeling/linear_model/ard_regression.py +51 -52
- snowflake/ml/modeling/linear_model/bayesian_ridge.py +51 -52
- snowflake/ml/modeling/linear_model/elastic_net.py +51 -52
- snowflake/ml/modeling/linear_model/elastic_net_cv.py +51 -52
- snowflake/ml/modeling/linear_model/gamma_regressor.py +51 -52
- snowflake/ml/modeling/linear_model/huber_regressor.py +51 -52
- snowflake/ml/modeling/linear_model/lars.py +51 -52
- snowflake/ml/modeling/linear_model/lars_cv.py +51 -52
- snowflake/ml/modeling/linear_model/lasso.py +51 -52
- snowflake/ml/modeling/linear_model/lasso_cv.py +51 -52
- snowflake/ml/modeling/linear_model/lasso_lars.py +51 -52
- snowflake/ml/modeling/linear_model/lasso_lars_cv.py +51 -52
- snowflake/ml/modeling/linear_model/lasso_lars_ic.py +51 -52
- snowflake/ml/modeling/linear_model/linear_regression.py +51 -52
- snowflake/ml/modeling/linear_model/logistic_regression.py +51 -52
- snowflake/ml/modeling/linear_model/logistic_regression_cv.py +51 -52
- snowflake/ml/modeling/linear_model/multi_task_elastic_net.py +51 -52
- snowflake/ml/modeling/linear_model/multi_task_elastic_net_cv.py +51 -52
- snowflake/ml/modeling/linear_model/multi_task_lasso.py +51 -52
- snowflake/ml/modeling/linear_model/multi_task_lasso_cv.py +51 -52
- snowflake/ml/modeling/linear_model/orthogonal_matching_pursuit.py +51 -52
- snowflake/ml/modeling/linear_model/passive_aggressive_classifier.py +51 -52
- snowflake/ml/modeling/linear_model/passive_aggressive_regressor.py +51 -52
- snowflake/ml/modeling/linear_model/perceptron.py +51 -52
- snowflake/ml/modeling/linear_model/poisson_regressor.py +51 -52
- snowflake/ml/modeling/linear_model/ransac_regressor.py +51 -52
- snowflake/ml/modeling/linear_model/ridge.py +51 -52
- snowflake/ml/modeling/linear_model/ridge_classifier.py +51 -52
- snowflake/ml/modeling/linear_model/ridge_classifier_cv.py +51 -52
- snowflake/ml/modeling/linear_model/ridge_cv.py +51 -52
- snowflake/ml/modeling/linear_model/sgd_classifier.py +51 -52
- snowflake/ml/modeling/linear_model/sgd_one_class_svm.py +51 -52
- snowflake/ml/modeling/linear_model/sgd_regressor.py +51 -52
- snowflake/ml/modeling/linear_model/theil_sen_regressor.py +51 -52
- snowflake/ml/modeling/linear_model/tweedie_regressor.py +51 -52
- snowflake/ml/modeling/manifold/isomap.py +53 -52
- snowflake/ml/modeling/manifold/mds.py +53 -52
- snowflake/ml/modeling/manifold/spectral_embedding.py +53 -52
- snowflake/ml/modeling/manifold/tsne.py +53 -52
- snowflake/ml/modeling/mixture/bayesian_gaussian_mixture.py +51 -52
- snowflake/ml/modeling/mixture/gaussian_mixture.py +51 -52
- snowflake/ml/modeling/model_selection/grid_search_cv.py +21 -23
- snowflake/ml/modeling/model_selection/randomized_search_cv.py +38 -20
- snowflake/ml/modeling/multiclass/one_vs_one_classifier.py +51 -52
- snowflake/ml/modeling/multiclass/one_vs_rest_classifier.py +51 -52
- snowflake/ml/modeling/multiclass/output_code_classifier.py +51 -52
- snowflake/ml/modeling/naive_bayes/bernoulli_nb.py +51 -52
- snowflake/ml/modeling/naive_bayes/categorical_nb.py +51 -52
- snowflake/ml/modeling/naive_bayes/complement_nb.py +51 -52
- snowflake/ml/modeling/naive_bayes/gaussian_nb.py +51 -52
- snowflake/ml/modeling/naive_bayes/multinomial_nb.py +51 -52
- snowflake/ml/modeling/neighbors/k_neighbors_classifier.py +51 -52
- snowflake/ml/modeling/neighbors/k_neighbors_regressor.py +51 -52
- snowflake/ml/modeling/neighbors/kernel_density.py +51 -52
- snowflake/ml/modeling/neighbors/local_outlier_factor.py +51 -52
- snowflake/ml/modeling/neighbors/nearest_centroid.py +51 -52
- snowflake/ml/modeling/neighbors/nearest_neighbors.py +51 -52
- snowflake/ml/modeling/neighbors/neighborhood_components_analysis.py +53 -52
- snowflake/ml/modeling/neighbors/radius_neighbors_classifier.py +51 -52
- snowflake/ml/modeling/neighbors/radius_neighbors_regressor.py +51 -52
- snowflake/ml/modeling/neural_network/bernoulli_rbm.py +53 -52
- snowflake/ml/modeling/neural_network/mlp_classifier.py +51 -52
- snowflake/ml/modeling/neural_network/mlp_regressor.py +51 -52
- snowflake/ml/modeling/pipeline/pipeline.py +538 -36
- snowflake/ml/modeling/preprocessing/one_hot_encoder.py +12 -0
- snowflake/ml/modeling/preprocessing/polynomial_features.py +53 -52
- snowflake/ml/modeling/semi_supervised/label_propagation.py +51 -52
- snowflake/ml/modeling/semi_supervised/label_spreading.py +51 -52
- snowflake/ml/modeling/svm/linear_svc.py +51 -52
- snowflake/ml/modeling/svm/linear_svr.py +51 -52
- snowflake/ml/modeling/svm/nu_svc.py +51 -52
- snowflake/ml/modeling/svm/nu_svr.py +51 -52
- snowflake/ml/modeling/svm/svc.py +51 -52
- snowflake/ml/modeling/svm/svr.py +51 -52
- snowflake/ml/modeling/tree/decision_tree_classifier.py +51 -52
- snowflake/ml/modeling/tree/decision_tree_regressor.py +51 -52
- snowflake/ml/modeling/tree/extra_tree_classifier.py +51 -52
- snowflake/ml/modeling/tree/extra_tree_regressor.py +51 -52
- snowflake/ml/modeling/xgboost/xgb_classifier.py +51 -52
- snowflake/ml/modeling/xgboost/xgb_regressor.py +51 -52
- snowflake/ml/modeling/xgboost/xgbrf_classifier.py +51 -52
- snowflake/ml/modeling/xgboost/xgbrf_regressor.py +51 -52
- snowflake/ml/registry/_manager/model_manager.py +36 -7
- snowflake/ml/registry/model_registry.py +3 -149
- snowflake/ml/version.py +1 -1
- {snowflake_ml_python-1.4.1.dist-info → snowflake_ml_python-1.5.1.dist-info}/METADATA +112 -7
- {snowflake_ml_python-1.4.1.dist-info → snowflake_ml_python-1.5.1.dist-info}/RECORD +216 -206
- snowflake/ml/registry/_artifact_manager.py +0 -156
- snowflake/ml/registry/artifact.py +0 -46
- {snowflake_ml_python-1.4.1.dist-info → snowflake_ml_python-1.5.1.dist-info}/LICENSE.txt +0 -0
- {snowflake_ml_python-1.4.1.dist-info → snowflake_ml_python-1.5.1.dist-info}/WHEEL +0 -0
- {snowflake_ml_python-1.4.1.dist-info → snowflake_ml_python-1.5.1.dist-info}/top_level.txt +0 -0
@@ -1,156 +0,0 @@
|
|
1
|
-
from typing import Optional, cast
|
2
|
-
|
3
|
-
from snowflake import connector, snowpark
|
4
|
-
from snowflake.ml._internal.utils import formatting, table_manager
|
5
|
-
from snowflake.ml.registry import _initial_schema, artifact
|
6
|
-
|
7
|
-
|
8
|
-
class ArtifactManager:
|
9
|
-
"""It manages artifacts in model registry."""
|
10
|
-
|
11
|
-
def __init__(
|
12
|
-
self,
|
13
|
-
session: snowpark.Session,
|
14
|
-
database_name: str,
|
15
|
-
schema_name: str,
|
16
|
-
) -> None:
|
17
|
-
"""Initializer of artifact manager.
|
18
|
-
|
19
|
-
Args:
|
20
|
-
session: Session object to communicate with Snowflake.
|
21
|
-
database_name: Desired name of the model registry database.
|
22
|
-
schema_name: Desired name of the schema used by this model registry inside the database.
|
23
|
-
"""
|
24
|
-
self._session = session
|
25
|
-
self._database_name = database_name
|
26
|
-
self._schema_name = schema_name
|
27
|
-
self._fully_qualified_table_name = table_manager.get_fully_qualified_table_name(
|
28
|
-
self._database_name, self._schema_name, _initial_schema._ARTIFACT_TABLE_NAME
|
29
|
-
)
|
30
|
-
|
31
|
-
def exists(
|
32
|
-
self,
|
33
|
-
artifact_name: str,
|
34
|
-
artifact_version: Optional[str] = None,
|
35
|
-
) -> bool:
|
36
|
-
"""Validate if an artifact exists.
|
37
|
-
|
38
|
-
Args:
|
39
|
-
artifact_name: Name of artifact.
|
40
|
-
artifact_version: Version of artifact.
|
41
|
-
|
42
|
-
Returns:
|
43
|
-
bool: True if the artifact exists, False otherwise.
|
44
|
-
"""
|
45
|
-
selected_artifact = self.get(artifact_name, artifact_version).collect()
|
46
|
-
|
47
|
-
assert (
|
48
|
-
len(selected_artifact) < 2
|
49
|
-
), f"""Multiple records found for artifact with name/version: {artifact_name}/{artifact_version}!"""
|
50
|
-
|
51
|
-
return len(selected_artifact) == 1
|
52
|
-
|
53
|
-
def add(
|
54
|
-
self,
|
55
|
-
artifact: artifact.Artifact,
|
56
|
-
artifact_id: str,
|
57
|
-
artifact_name: str,
|
58
|
-
artifact_version: Optional[str] = None,
|
59
|
-
) -> artifact.Artifact:
|
60
|
-
"""
|
61
|
-
Add a new artifact.
|
62
|
-
|
63
|
-
Args:
|
64
|
-
artifact: artifact object.
|
65
|
-
artifact_id: id of artifact.
|
66
|
-
artifact_name: name of artifact.
|
67
|
-
artifact_version: version of artifact.
|
68
|
-
|
69
|
-
Returns:
|
70
|
-
A reference to artifact.
|
71
|
-
"""
|
72
|
-
if artifact_version is None:
|
73
|
-
artifact_version = ""
|
74
|
-
assert artifact_id != "", "Artifact id can't be empty."
|
75
|
-
|
76
|
-
new_artifact = {
|
77
|
-
"ID": artifact_id,
|
78
|
-
"TYPE": artifact.type.value,
|
79
|
-
"NAME": artifact_name,
|
80
|
-
"VERSION": artifact_version,
|
81
|
-
"CREATION_ROLE": self._session.get_current_role(),
|
82
|
-
"CREATION_TIME": formatting.SqlStr("CURRENT_TIMESTAMP()"),
|
83
|
-
"ARTIFACT_SPEC": artifact._spec,
|
84
|
-
}
|
85
|
-
|
86
|
-
# TODO: Consider updating the METADATA table for artifact history tracking as well.
|
87
|
-
table_manager.insert_table_entry(self._session, self._fully_qualified_table_name, new_artifact)
|
88
|
-
artifact._log(name=artifact_name, version=artifact_version, id=artifact_id)
|
89
|
-
return artifact
|
90
|
-
|
91
|
-
def delete(
|
92
|
-
self,
|
93
|
-
artifact_name: str,
|
94
|
-
artifact_version: Optional[str] = None,
|
95
|
-
error_if_not_exist: bool = False,
|
96
|
-
) -> None:
|
97
|
-
"""
|
98
|
-
Remove an artifact.
|
99
|
-
|
100
|
-
Args:
|
101
|
-
artifact_name: Name of artifact.
|
102
|
-
artifact_version: Version of artifact.
|
103
|
-
error_if_not_exist: Whether to raise errors if the target entry doesn't exist. Default to be false.
|
104
|
-
|
105
|
-
Raises:
|
106
|
-
DataError: If error_if_not_exist is true and the artifact doesn't exist in the database.
|
107
|
-
RuntimeError: If the artifact deletion failed.
|
108
|
-
"""
|
109
|
-
if not self.exists(artifact_name, artifact_version):
|
110
|
-
if error_if_not_exist:
|
111
|
-
raise connector.DataError(
|
112
|
-
f"Artifact {artifact_name}/{artifact_version} doesn't exist. Deletion failed."
|
113
|
-
)
|
114
|
-
else:
|
115
|
-
return
|
116
|
-
|
117
|
-
if artifact_version is None:
|
118
|
-
artifact_version = ""
|
119
|
-
delete_query = f"""DELETE FROM {self._fully_qualified_table_name}
|
120
|
-
WHERE NAME='{artifact_name}' AND VERSION='{artifact_version}'
|
121
|
-
"""
|
122
|
-
|
123
|
-
# TODO: Consider updating the METADATA table for artifact history tracking as well.
|
124
|
-
try:
|
125
|
-
self._session.sql(delete_query).collect()
|
126
|
-
except Exception as e:
|
127
|
-
raise RuntimeError(f"Delete artifact {artifact_name}/{artifact_version} failed due to {e}")
|
128
|
-
|
129
|
-
def get(
|
130
|
-
self,
|
131
|
-
artifact_name: str,
|
132
|
-
artifact_version: Optional[str] = None,
|
133
|
-
) -> snowpark.DataFrame:
|
134
|
-
"""Retrieve the Snowpark dataframe of the artifact matching the provided artifact id and type.
|
135
|
-
|
136
|
-
Given that ID and TYPE act as a compound primary key for the artifact table,
|
137
|
-
the resulting dataframe should have at most, one row.
|
138
|
-
|
139
|
-
Args:
|
140
|
-
artifact_name: Name of artifact.
|
141
|
-
artifact_version: Version of artifact.
|
142
|
-
|
143
|
-
Returns:
|
144
|
-
A Snowpark dataframe representing the artifacts that match the given constraints.
|
145
|
-
|
146
|
-
WARNING:
|
147
|
-
The returned DataFrame is writable and shouldn't be made accessible to users.
|
148
|
-
"""
|
149
|
-
if artifact_version is None:
|
150
|
-
artifact_version = ""
|
151
|
-
|
152
|
-
artifacts = self._session.sql(f"SELECT * FROM {self._fully_qualified_table_name}")
|
153
|
-
target_artifact = artifacts.filter(snowpark.Column("NAME") == artifact_name).filter(
|
154
|
-
snowpark.Column("VERSION") == artifact_version
|
155
|
-
)
|
156
|
-
return cast(snowpark.DataFrame, target_artifact)
|
@@ -1,46 +0,0 @@
|
|
1
|
-
import enum
|
2
|
-
from typing import Optional
|
3
|
-
|
4
|
-
|
5
|
-
# Set of allowed artifact types.
|
6
|
-
class ArtifactType(enum.Enum):
|
7
|
-
TESTTYPE = "TESTTYPE" # A placeholder type just for unit test
|
8
|
-
DATASET = "DATASET"
|
9
|
-
|
10
|
-
|
11
|
-
class Artifact:
|
12
|
-
"""
|
13
|
-
A reference to artifact.
|
14
|
-
|
15
|
-
Properties:
|
16
|
-
id: A globally unique id represents this artifact.
|
17
|
-
spec: Specification of artifact in json format.
|
18
|
-
type: Type of artifact.
|
19
|
-
name: Name of artifact.
|
20
|
-
version: Version of artifact.
|
21
|
-
"""
|
22
|
-
|
23
|
-
def __init__(self, type: ArtifactType, spec: str) -> None:
|
24
|
-
"""Create an artifact.
|
25
|
-
|
26
|
-
Args:
|
27
|
-
type: type of artifact.
|
28
|
-
spec: specification in json format.
|
29
|
-
"""
|
30
|
-
self.type: ArtifactType = type
|
31
|
-
self.name: Optional[str] = None
|
32
|
-
self.version: Optional[str] = None
|
33
|
-
self._spec: str = spec
|
34
|
-
self._id: Optional[str] = None
|
35
|
-
|
36
|
-
def _log(self, name: str, version: str, id: str) -> None:
|
37
|
-
"""Additional information when this artifact is logged.
|
38
|
-
|
39
|
-
Args:
|
40
|
-
name: name of artifact.
|
41
|
-
version: version of artifact.
|
42
|
-
id: A global unique id represents this artifact.
|
43
|
-
"""
|
44
|
-
self.name = name
|
45
|
-
self.version = version
|
46
|
-
self._id = id
|
File without changes
|
File without changes
|
File without changes
|