snowpark-checkpoints-configuration 0.2.0rc1__py3-none-any.whl → 0.3.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.
@@ -0,0 +1,32 @@
1
+ # Copyright 2025 Snowflake Inc.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ import logging
17
+
18
+
19
+ # Add a NullHandler to prevent logging messages from being output to
20
+ # sys.stderr if no logging configuration is provided.
21
+ logging.getLogger(__name__).addHandler(logging.NullHandler())
22
+
23
+ # ruff: noqa: E402
24
+
25
+ from snowflake.snowpark_checkpoints_configuration.checkpoint_metadata import (
26
+ CheckpointMetadata,
27
+ )
28
+
29
+
30
+ __all__ = [
31
+ "CheckpointMetadata",
32
+ ]
@@ -0,0 +1,16 @@
1
+ # Copyright 2025 Snowflake Inc.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ __version__ = "0.3.0"
@@ -0,0 +1,76 @@
1
+ # Copyright 2025 Snowflake Inc.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ import logging
17
+ import os
18
+
19
+ from typing import Optional
20
+
21
+ from snowflake.snowpark_checkpoints_configuration.io_utils.io_file_manager import (
22
+ get_io_file_manager,
23
+ )
24
+ from snowflake.snowpark_checkpoints_configuration.model.checkpoints import (
25
+ Checkpoint,
26
+ Checkpoints,
27
+ )
28
+ from snowflake.snowpark_checkpoints_configuration.singleton import Singleton
29
+
30
+
31
+ LOGGER = logging.getLogger(__name__)
32
+
33
+
34
+ class CheckpointMetadata(metaclass=Singleton):
35
+
36
+ """CheckpointMetadata class.
37
+
38
+ This is a singleton class that reads the checkpoints.json file
39
+ and provides an interface to get the checkpoint configuration.
40
+
41
+ Args:
42
+ metaclass (Singleton, optional): Defaults to Singleton.
43
+
44
+ """
45
+
46
+ def __init__(self, path: Optional[str] = None):
47
+ self.checkpoint_model: Checkpoints = Checkpoints(type="", pipelines=[])
48
+ directory = path if path is not None else get_io_file_manager().getcwd()
49
+ checkpoints_file = os.path.join(directory, "checkpoints.json")
50
+ if get_io_file_manager().file_exists(checkpoints_file):
51
+ LOGGER.info("Reading checkpoints file: '%s'", checkpoints_file)
52
+ try:
53
+ checkpoint_json = get_io_file_manager().read(checkpoints_file)
54
+ self.checkpoint_model = Checkpoints.model_validate_json(checkpoint_json)
55
+ LOGGER.info(
56
+ "Successfully read and validated checkpoints file: '%s'",
57
+ checkpoints_file,
58
+ )
59
+ except Exception as e:
60
+ error_msg = f"An error occurred while reading the checkpoints file: '{checkpoints_file}'"
61
+ LOGGER.exception(error_msg)
62
+ raise Exception(f"{error_msg} \n {e}") from None
63
+ else:
64
+ LOGGER.warning("Checkpoints file not found: '%s'", checkpoints_file)
65
+
66
+ def get_checkpoint(self, checkpoint_name: str) -> Checkpoint:
67
+ """Get a checkpoint by its name.
68
+
69
+ Args:
70
+ checkpoint_name (str): checkpoint name
71
+
72
+ Returns:
73
+ Checkpoint: Checkpoint configuration instance
74
+
75
+ """
76
+ return self.checkpoint_model.get_check_point(checkpoint_name=checkpoint_name)
@@ -0,0 +1,53 @@
1
+ # Copyright 2025 Snowflake Inc.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ import re as regx
17
+
18
+
19
+ CHECKPOINT_NAME_REGEX_PATTERN = r"[a-zA-Z_][a-zA-Z0-9_$]+"
20
+ TRANSLATION_TABLE = str.maketrans({" ": "_", "-": "_"})
21
+
22
+
23
+ def normalize_checkpoint_name(checkpoint_name: str) -> str:
24
+ """Normalize the provided checkpoint name by replacing: the whitespace and hyphen tokens by underscore token.
25
+
26
+ Args:
27
+ checkpoint_name (str): The checkpoint name to normalize.
28
+
29
+ Returns:
30
+ str: the checkpoint name normalized.
31
+
32
+ """
33
+ normalized_checkpoint_name = checkpoint_name.translate(TRANSLATION_TABLE)
34
+ return normalized_checkpoint_name
35
+
36
+
37
+ def is_valid_checkpoint_name(checkpoint_name: str) -> bool:
38
+ """Check if the provided checkpoint name is valid.
39
+
40
+ A valid checkpoint name must:
41
+ - Start with a letter (a-z, A-Z) or an underscore (_)
42
+ - Be followed by any combination of letters, digits (0-9), underscores (_), and dollar signs ($).
43
+
44
+ Args:
45
+ checkpoint_name (str): The checkpoint name to validate.
46
+
47
+ Returns:
48
+ bool: True if the checkpoint name is valid; otherwise, False.
49
+
50
+ """
51
+ matched = regx.fullmatch(CHECKPOINT_NAME_REGEX_PATTERN, checkpoint_name)
52
+ is_valid = bool(matched)
53
+ return is_valid
@@ -0,0 +1,26 @@
1
+ # Copyright 2025 Snowflake Inc.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ __all__ = ["EnvStrategy", "IOFileManager", "IODefaultStrategy"]
17
+
18
+ from snowflake.snowpark_checkpoints_configuration.io_utils.io_env_strategy import (
19
+ EnvStrategy,
20
+ )
21
+ from snowflake.snowpark_checkpoints_configuration.io_utils.io_default_strategy import (
22
+ IODefaultStrategy,
23
+ )
24
+ from snowflake.snowpark_checkpoints_configuration.io_utils.io_file_manager import (
25
+ IOFileManager,
26
+ )
@@ -0,0 +1,34 @@
1
+ # Copyright 2025 Snowflake Inc.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ import os
17
+
18
+ from typing import Optional
19
+
20
+ from snowflake.snowpark_checkpoints_configuration.io_utils import EnvStrategy
21
+
22
+
23
+ class IODefaultStrategy(EnvStrategy):
24
+ def file_exists(self, path: str) -> bool:
25
+ return os.path.isfile(path)
26
+
27
+ def read(
28
+ self, file_path: str, mode: str = "r", encoding: Optional[str] = None
29
+ ) -> str:
30
+ with open(file_path, mode=mode, encoding=encoding) as file:
31
+ return file.read()
32
+
33
+ def getcwd(self) -> str:
34
+ return os.getcwd()
@@ -0,0 +1,62 @@
1
+ # Copyright 2025 Snowflake Inc.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ from abc import ABC, abstractmethod
17
+ from typing import Optional
18
+
19
+
20
+ class EnvStrategy(ABC):
21
+
22
+ """An abstract base class that defines methods for file and directory operations.
23
+
24
+ Subclasses should implement these methods to provide environment-specific behavior.
25
+ """
26
+
27
+ @abstractmethod
28
+ def file_exists(self, path: str) -> bool:
29
+ """Check if a file exists.
30
+
31
+ Args:
32
+ path: The path to the file.
33
+
34
+ Returns:
35
+ bool: True if the file exists, False otherwise.
36
+
37
+ """
38
+
39
+ @abstractmethod
40
+ def read(
41
+ self, file_path: str, mode: str = "r", encoding: Optional[str] = None
42
+ ) -> str:
43
+ """Read content from a file.
44
+
45
+ Args:
46
+ file_path: The path to the file to read from.
47
+ mode: The mode in which to open the file.
48
+ encoding: The encoding to use for reading the file.
49
+
50
+ Returns:
51
+ str: The content of the file.
52
+
53
+ """
54
+
55
+ @abstractmethod
56
+ def getcwd(self) -> str:
57
+ """Get the current working directory.
58
+
59
+ Returns:
60
+ str: The current working directory.
61
+
62
+ """
@@ -0,0 +1,57 @@
1
+ # Copyright 2025 Snowflake Inc.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ from typing import Optional
17
+
18
+ from snowflake.snowpark_checkpoints_configuration.io_utils import (
19
+ EnvStrategy,
20
+ IODefaultStrategy,
21
+ )
22
+ from snowflake.snowpark_checkpoints_configuration.singleton import Singleton
23
+
24
+
25
+ class IOFileManager(metaclass=Singleton):
26
+ def __init__(self, strategy: Optional[EnvStrategy] = None):
27
+ self.strategy = strategy or IODefaultStrategy()
28
+
29
+ def file_exists(self, path: str) -> bool:
30
+ return self.strategy.file_exists(path)
31
+
32
+ def read(
33
+ self, file_path: str, mode: str = "r", encoding: Optional[str] = None
34
+ ) -> str:
35
+ return self.strategy.read(file_path, mode, encoding)
36
+
37
+ def getcwd(self) -> str:
38
+ return self.strategy.getcwd()
39
+
40
+ def set_strategy(self, strategy: EnvStrategy):
41
+ """Set the strategy for file and directory operations.
42
+
43
+ Args:
44
+ strategy (EnvStrategy): The strategy to use for file and directory operations.
45
+
46
+ """
47
+ self.strategy = strategy
48
+
49
+
50
+ def get_io_file_manager():
51
+ """Get the singleton instance of IOFileManager.
52
+
53
+ Returns:
54
+ IOFileManager: The singleton instance of IOFileManager.
55
+
56
+ """
57
+ return IOFileManager()
@@ -0,0 +1,154 @@
1
+ # Copyright 2025 Snowflake Inc.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+ import logging
17
+
18
+ from typing import Optional
19
+
20
+ from pydantic import BaseModel, ConfigDict, field_validator
21
+ from pydantic.alias_generators import to_camel
22
+
23
+ from snowflake.snowpark_checkpoints_configuration import checkpoint_name_utils
24
+
25
+
26
+ LOGGER = logging.getLogger(__name__)
27
+
28
+
29
+ class Checkpoint(BaseModel):
30
+
31
+ """Checkpoint model.
32
+
33
+ Args:
34
+ pydantic.BaseModel (pydantic.BaseModel): pydantic BaseModel
35
+
36
+ """
37
+
38
+ name: str
39
+ mode: int = 1
40
+ function: Optional[str] = None
41
+ df: Optional[str] = None
42
+ sample: Optional[float] = None
43
+ file: Optional[str] = None
44
+ location: int = -1
45
+ enabled: bool = True
46
+
47
+ @field_validator("name", mode="before")
48
+ @classmethod
49
+ def normalize(cls, name: str) -> str:
50
+ LOGGER.debug("Normalizing checkpoint name: '%s'", name)
51
+ normalized_name = checkpoint_name_utils.normalize_checkpoint_name(name)
52
+ LOGGER.debug("Checkpoint name was normalized to: '%s'", normalized_name)
53
+ is_valid_checkpoint_name = checkpoint_name_utils.is_valid_checkpoint_name(
54
+ normalized_name
55
+ )
56
+ if not is_valid_checkpoint_name:
57
+ error_msg = (
58
+ f"Invalid checkpoint name: {name} in checkpoints.json file. "
59
+ f"Checkpoint names must only contain alphanumeric characters, underscores and dollar signs."
60
+ )
61
+ LOGGER.error(error_msg)
62
+ raise Exception(error_msg)
63
+
64
+ return normalized_name
65
+
66
+
67
+ class Pipeline(BaseModel):
68
+
69
+ """Pipeline model.
70
+
71
+ Args:
72
+ pydantic.BaseModel (pydantic.BaseModel): pydantic BaseModel
73
+
74
+ """
75
+
76
+ model_config = ConfigDict(
77
+ alias_generator=to_camel,
78
+ populate_by_name=True,
79
+ from_attributes=True,
80
+ )
81
+
82
+ entry_point: str
83
+ checkpoints: list[Checkpoint]
84
+
85
+
86
+ class Checkpoints(BaseModel):
87
+
88
+ """Checkpoints model.
89
+
90
+ Args:
91
+ pydantic.BaseModel (pydantic.BaseModel): pydantic BaseModel
92
+
93
+ Returns:
94
+ Checkpoints: An instance of the Checkpoints class
95
+
96
+ """
97
+
98
+ type: str
99
+ pipelines: list[Pipeline]
100
+
101
+ # this dictionary holds the unpacked checkpoints from the different pipelines.
102
+ _checkpoints = {}
103
+
104
+ def _build_checkpoints_dict(self):
105
+ LOGGER.debug("Building checkpoints dictionary from pipelines.")
106
+ for pipeline in self.pipelines:
107
+ LOGGER.debug("Processing pipeline: '%s'", pipeline.entry_point)
108
+ for checkpoint in pipeline.checkpoints:
109
+ LOGGER.debug("Adding checkpoint: %s", checkpoint)
110
+ self._checkpoints[checkpoint.name] = checkpoint
111
+
112
+ def get_check_point(self, checkpoint_name: str) -> Checkpoint:
113
+ """Get a checkpoint by its name.
114
+
115
+ Args:
116
+ checkpoint_name (str): The name of the checkpoint.
117
+
118
+ Returns:
119
+ Checkpoint: The checkpoint object if found, otherwise a new Checkpoint object
120
+ with the name set to the checkpoint_id.
121
+
122
+ """
123
+ LOGGER.info("Fetching checkpoint: '%s'", checkpoint_name)
124
+ if not self._checkpoints:
125
+ LOGGER.debug("Checkpoints dictionary is empty, building it...")
126
+ self._build_checkpoints_dict()
127
+
128
+ checkpoint = self._checkpoints.get(checkpoint_name)
129
+ if len(self._checkpoints) == 0:
130
+ LOGGER.info(
131
+ "No checkpoints found, creating a new enabled checkpoint with name: '%s'",
132
+ checkpoint_name,
133
+ )
134
+ checkpoint = Checkpoint(name=checkpoint_name, enabled=True)
135
+ elif checkpoint is None:
136
+ LOGGER.info(
137
+ "Checkpoint not found, creating a new disabled checkpoint with name: '%s'",
138
+ checkpoint_name,
139
+ )
140
+ checkpoint = Checkpoint(name=checkpoint_name, enabled=False)
141
+
142
+ LOGGER.debug("Returning checkpoint: %s", checkpoint)
143
+ return checkpoint
144
+
145
+ def add_checkpoint(self, checkpoint: Checkpoint) -> None:
146
+ """Add a checkpoint to the checkpoints' dictionary.
147
+
148
+ Args:
149
+ checkpoint (Checkpoint): The checkpoint object to add
150
+
151
+ """
152
+ LOGGER.debug("Adding checkpoint: %s", checkpoint)
153
+ self._checkpoints[checkpoint.name] = checkpoint
154
+ LOGGER.info("Checkpoint '%s' added successfully.", checkpoint.name)
@@ -0,0 +1,23 @@
1
+ # Copyright 2025 Snowflake Inc.
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
16
+
17
+ class Singleton(type):
18
+ _instances = {}
19
+
20
+ def __call__(cls, *args, **kwargs):
21
+ if cls not in cls._instances:
22
+ cls._instances[cls] = super().__call__(*args, **kwargs)
23
+ return cls._instances[cls]
@@ -0,0 +1,63 @@
1
+ Metadata-Version: 2.4
2
+ Name: snowpark-checkpoints-configuration
3
+ Version: 0.3.0
4
+ Summary: Migration tools for Snowpark
5
+ Project-URL: Bug Tracker, https://github.com/snowflakedb/snowpark-checkpoints/issues
6
+ Project-URL: Source code, https://github.com/snowflakedb/snowpark-checkpoints/
7
+ Author-email: "Snowflake, Inc." <snowflake-python-libraries-dl@snowflake.com>
8
+ License: Apache License, Version 2.0
9
+ License-File: LICENSE
10
+ Keywords: Snowflake,Snowpark,analytics,cloud,database,db
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Environment :: Other Environment
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Education
16
+ Classifier: Intended Audience :: Information Technology
17
+ Classifier: Intended Audience :: System Administrators
18
+ Classifier: License :: OSI Approved :: Apache Software License
19
+ Classifier: Operating System :: OS Independent
20
+ Classifier: Programming Language :: Python :: 3 :: Only
21
+ Classifier: Programming Language :: SQL
22
+ Classifier: Topic :: Database
23
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
24
+ Classifier: Topic :: Software Development
25
+ Classifier: Topic :: Software Development :: Libraries
26
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
27
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
28
+ Requires-Python: <3.12,>=3.9
29
+ Requires-Dist: pydantic>=1.8.2
30
+ Requires-Dist: snowflake-snowpark-python>=1.23.0
31
+ Provides-Extra: development
32
+ Requires-Dist: certifi==2025.1.31; extra == 'development'
33
+ Requires-Dist: coverage>=7.6.7; extra == 'development'
34
+ Requires-Dist: hatchling==1.25.0; extra == 'development'
35
+ Requires-Dist: pre-commit>=4.0.1; extra == 'development'
36
+ Requires-Dist: pyarrow>=18.0.0; extra == 'development'
37
+ Requires-Dist: pytest-cov>=6.0.0; extra == 'development'
38
+ Requires-Dist: pytest>=8.3.3; extra == 'development'
39
+ Requires-Dist: setuptools>=70.0.0; extra == 'development'
40
+ Requires-Dist: twine==5.1.1; extra == 'development'
41
+ Description-Content-Type: text/markdown
42
+
43
+ # snowpark-checkpoints-configuration
44
+
45
+ ---
46
+ ##### This package is on Public Preview.
47
+ ---
48
+ **snowpark-checkpoints-configuration** is a module for loading `checkpoint.json` and provides a model.
49
+ This module will work automatically with *snowpark-checkpoints-collector* and *snowpark-checkpoints-validators*. This will try to read the configuration file from the current working directory.
50
+
51
+ ## Usage
52
+
53
+ To explicit load a file, you can import `CheckpointMetadata` and create an instance as shown below:
54
+
55
+ ```python
56
+ from snowflake.snowpark_checkpoints_configuration import CheckpointMetadata
57
+
58
+ my_checkpoint_metadata = CheckpointMetadata("path/to/checkpoint.json")
59
+
60
+ checkpoint_model = my_checkpoint_metadata.get_checkpoint("my_checkpoint_name")
61
+ ...
62
+ ```
63
+ ------
@@ -0,0 +1,14 @@
1
+ snowflake/snowpark_checkpoints_configuration/__init__.py,sha256=xZ2oBwJeEso0laWYDaXQidGt_MdjgNsOZ1_0BcZcXvE,980
2
+ snowflake/snowpark_checkpoints_configuration/__version__.py,sha256=kbbDnlkY7JOLNHvfWYkCO_mOBOV9GniMGdxYoQpLhyg,632
3
+ snowflake/snowpark_checkpoints_configuration/checkpoint_metadata.py,sha256=fdmZpZxzqwtYfCjwjkl_9M8Z1hY04f_vE05HfGVRQc4,2773
4
+ snowflake/snowpark_checkpoints_configuration/checkpoint_name_utils.py,sha256=Xc4k3JU6A96-79VFRR8NrNAUPeO3V1DEAhngg-hLlU4,1787
5
+ snowflake/snowpark_checkpoints_configuration/singleton.py,sha256=7AgIHQBXVRvPBBCkmBplzkdrrm-xVWf_N8svzA2vF8E,836
6
+ snowflake/snowpark_checkpoints_configuration/io_utils/__init__.py,sha256=UgACTfonQw5bMAAuU_CrtVTzVVKxxK6NEDOogNl2qJM,996
7
+ snowflake/snowpark_checkpoints_configuration/io_utils/io_default_strategy.py,sha256=TX0xhezFmO5f37SsNP8nhsfAfRWJ2YwYPOE_pefJvsg,1113
8
+ snowflake/snowpark_checkpoints_configuration/io_utils/io_env_strategy.py,sha256=h6gjwBqOhyJHxAvWa7kL4jvyqF31ssTWGkQCAH99rd8,1735
9
+ snowflake/snowpark_checkpoints_configuration/io_utils/io_file_manager.py,sha256=H_xNLycfia2R_35xF1ery41i1BqFzysEuQjkL5sZeEs,1782
10
+ snowflake/snowpark_checkpoints_configuration/model/checkpoints.py,sha256=R1L9kA6rhZxftw6iq7p4FwswcrJvU8HRn0XOkv6bRJA,4852
11
+ snowpark_checkpoints_configuration-0.3.0.dist-info/METADATA,sha256=Bjd-RHBmSKluYnJGbrsNEggmPwgJacvGGhBESZHT1i4,2782
12
+ snowpark_checkpoints_configuration-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
13
+ snowpark_checkpoints_configuration-0.3.0.dist-info/licenses/LICENSE,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
14
+ snowpark_checkpoints_configuration-0.3.0.dist-info/RECORD,,
@@ -175,28 +175,3 @@
175
175
  of your accepting any such warranty or additional liability.
176
176
 
177
177
  END OF TERMS AND CONDITIONS
178
-
179
- APPENDIX: How to apply the Apache License to your work.
180
-
181
- To apply the Apache License to your work, attach the following
182
- boilerplate notice, with the fields enclosed by brackets "[]"
183
- replaced with your own identifying information. (Don't include
184
- the brackets!) The text should be enclosed in the appropriate
185
- comment syntax for the file format. We also recommend that a
186
- file or class name and description of purpose be included on the
187
- same "printed page" as the copyright notice for easier
188
- identification within third-party archives.
189
-
190
- Copyright 2025 Snowflake
191
-
192
- Licensed under the Apache License, Version 2.0 (the "License");
193
- you may not use this file except in compliance with the License.
194
- You may obtain a copy of the License at
195
-
196
- http://www.apache.org/licenses/LICENSE-2.0
197
-
198
- Unless required by applicable law or agreed to in writing, software
199
- distributed under the License is distributed on an "AS IS" BASIS,
200
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- See the License for the specific language governing permissions and
202
- limitations under the License.
@@ -1,267 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: snowpark-checkpoints-configuration
3
- Version: 0.2.0rc1
4
- Summary: Migration tools for Snowpark
5
- Project-URL: Bug Tracker, https://github.com/snowflakedb/snowpark-checkpoints/issues
6
- Project-URL: Source code, https://github.com/snowflakedb/snowpark-checkpoints/
7
- Author: Snowflake Inc.
8
- License:
9
- Apache License
10
- Version 2.0, January 2004
11
- http://www.apache.org/licenses/
12
-
13
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
14
-
15
- 1. Definitions.
16
-
17
- "License" shall mean the terms and conditions for use, reproduction,
18
- and distribution as defined by Sections 1 through 9 of this document.
19
-
20
- "Licensor" shall mean the copyright owner or entity authorized by
21
- the copyright owner that is granting the License.
22
-
23
- "Legal Entity" shall mean the union of the acting entity and all
24
- other entities that control, are controlled by, or are under common
25
- control with that entity. For the purposes of this definition,
26
- "control" means (i) the power, direct or indirect, to cause the
27
- direction or management of such entity, whether by contract or
28
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
29
- outstanding shares, or (iii) beneficial ownership of such entity.
30
-
31
- "You" (or "Your") shall mean an individual or Legal Entity
32
- exercising permissions granted by this License.
33
-
34
- "Source" form shall mean the preferred form for making modifications,
35
- including but not limited to software source code, documentation
36
- source, and configuration files.
37
-
38
- "Object" form shall mean any form resulting from mechanical
39
- transformation or translation of a Source form, including but
40
- not limited to compiled object code, generated documentation,
41
- and conversions to other media types.
42
-
43
- "Work" shall mean the work of authorship, whether in Source or
44
- Object form, made available under the License, as indicated by a
45
- copyright notice that is included in or attached to the work
46
- (an example is provided in the Appendix below).
47
-
48
- "Derivative Works" shall mean any work, whether in Source or Object
49
- form, that is based on (or derived from) the Work and for which the
50
- editorial revisions, annotations, elaborations, or other modifications
51
- represent, as a whole, an original work of authorship. For the purposes
52
- of this License, Derivative Works shall not include works that remain
53
- separable from, or merely link (or bind by name) to the interfaces of,
54
- the Work and Derivative Works thereof.
55
-
56
- "Contribution" shall mean any work of authorship, including
57
- the original version of the Work and any modifications or additions
58
- to that Work or Derivative Works thereof, that is intentionally
59
- submitted to Licensor for inclusion in the Work by the copyright owner
60
- or by an individual or Legal Entity authorized to submit on behalf of
61
- the copyright owner. For the purposes of this definition, "submitted"
62
- means any form of electronic, verbal, or written communication sent
63
- to the Licensor or its representatives, including but not limited to
64
- communication on electronic mailing lists, source code control systems,
65
- and issue tracking systems that are managed by, or on behalf of, the
66
- Licensor for the purpose of discussing and improving the Work, but
67
- excluding communication that is conspicuously marked or otherwise
68
- designated in writing by the copyright owner as "Not a Contribution."
69
-
70
- "Contributor" shall mean Licensor and any individual or Legal Entity
71
- on behalf of whom a Contribution has been received by Licensor and
72
- subsequently incorporated within the Work.
73
-
74
- 2. Grant of Copyright License. Subject to the terms and conditions of
75
- this License, each Contributor hereby grants to You a perpetual,
76
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
- copyright license to reproduce, prepare Derivative Works of,
78
- publicly display, publicly perform, sublicense, and distribute the
79
- Work and such Derivative Works in Source or Object form.
80
-
81
- 3. Grant of Patent License. Subject to the terms and conditions of
82
- this License, each Contributor hereby grants to You a perpetual,
83
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
84
- (except as stated in this section) patent license to make, have made,
85
- use, offer to sell, sell, import, and otherwise transfer the Work,
86
- where such license applies only to those patent claims licensable
87
- by such Contributor that are necessarily infringed by their
88
- Contribution(s) alone or by combination of their Contribution(s)
89
- with the Work to which such Contribution(s) was submitted. If You
90
- institute patent litigation against any entity (including a
91
- cross-claim or counterclaim in a lawsuit) alleging that the Work
92
- or a Contribution incorporated within the Work constitutes direct
93
- or contributory patent infringement, then any patent licenses
94
- granted to You under this License for that Work shall terminate
95
- as of the date such litigation is filed.
96
-
97
- 4. Redistribution. You may reproduce and distribute copies of the
98
- Work or Derivative Works thereof in any medium, with or without
99
- modifications, and in Source or Object form, provided that You
100
- meet the following conditions:
101
-
102
- (a) You must give any other recipients of the Work or
103
- Derivative Works a copy of this License; and
104
-
105
- (b) You must cause any modified files to carry prominent notices
106
- stating that You changed the files; and
107
-
108
- (c) You must retain, in the Source form of any Derivative Works
109
- that You distribute, all copyright, patent, trademark, and
110
- attribution notices from the Source form of the Work,
111
- excluding those notices that do not pertain to any part of
112
- the Derivative Works; and
113
-
114
- (d) If the Work includes a "NOTICE" text file as part of its
115
- distribution, then any Derivative Works that You distribute must
116
- include a readable copy of the attribution notices contained
117
- within such NOTICE file, excluding those notices that do not
118
- pertain to any part of the Derivative Works, in at least one
119
- of the following places: within a NOTICE text file distributed
120
- as part of the Derivative Works; within the Source form or
121
- documentation, if provided along with the Derivative Works; or,
122
- within a display generated by the Derivative Works, if and
123
- wherever such third-party notices normally appear. The contents
124
- of the NOTICE file are for informational purposes only and
125
- do not modify the License. You may add Your own attribution
126
- notices within Derivative Works that You distribute, alongside
127
- or as an addendum to the NOTICE text from the Work, provided
128
- that such additional attribution notices cannot be construed
129
- as modifying the License.
130
-
131
- You may add Your own copyright statement to Your modifications and
132
- may provide additional or different license terms and conditions
133
- for use, reproduction, or distribution of Your modifications, or
134
- for any such Derivative Works as a whole, provided Your use,
135
- reproduction, and distribution of the Work otherwise complies with
136
- the conditions stated in this License.
137
-
138
- 5. Submission of Contributions. Unless You explicitly state otherwise,
139
- any Contribution intentionally submitted for inclusion in the Work
140
- by You to the Licensor shall be under the terms and conditions of
141
- this License, without any additional terms or conditions.
142
- Notwithstanding the above, nothing herein shall supersede or modify
143
- the terms of any separate license agreement you may have executed
144
- with Licensor regarding such Contributions.
145
-
146
- 6. Trademarks. This License does not grant permission to use the trade
147
- names, trademarks, service marks, or product names of the Licensor,
148
- except as required for reasonable and customary use in describing the
149
- origin of the Work and reproducing the content of the NOTICE file.
150
-
151
- 7. Disclaimer of Warranty. Unless required by applicable law or
152
- agreed to in writing, Licensor provides the Work (and each
153
- Contributor provides its Contributions) on an "AS IS" BASIS,
154
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
155
- implied, including, without limitation, any warranties or conditions
156
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
157
- PARTICULAR PURPOSE. You are solely responsible for determining the
158
- appropriateness of using or redistributing the Work and assume any
159
- risks associated with Your exercise of permissions under this License.
160
-
161
- 8. Limitation of Liability. In no event and under no legal theory,
162
- whether in tort (including negligence), contract, or otherwise,
163
- unless required by applicable law (such as deliberate and grossly
164
- negligent acts) or agreed to in writing, shall any Contributor be
165
- liable to You for damages, including any direct, indirect, special,
166
- incidental, or consequential damages of any character arising as a
167
- result of this License or out of the use or inability to use the
168
- Work (including but not limited to damages for loss of goodwill,
169
- work stoppage, computer failure or malfunction, or any and all
170
- other commercial damages or losses), even if such Contributor
171
- has been advised of the possibility of such damages.
172
-
173
- 9. Accepting Warranty or Additional Liability. While redistributing
174
- the Work or Derivative Works thereof, You may choose to offer,
175
- and charge a fee for, acceptance of support, warranty, indemnity,
176
- or other liability obligations and/or rights consistent with this
177
- License. However, in accepting such obligations, You may act only
178
- on Your own behalf and on Your sole responsibility, not on behalf
179
- of any other Contributor, and only if You agree to indemnify,
180
- defend, and hold each Contributor harmless for any liability
181
- incurred by, or claims asserted against, such Contributor by reason
182
- of your accepting any such warranty or additional liability.
183
-
184
- END OF TERMS AND CONDITIONS
185
-
186
- APPENDIX: How to apply the Apache License to your work.
187
-
188
- To apply the Apache License to your work, attach the following
189
- boilerplate notice, with the fields enclosed by brackets "[]"
190
- replaced with your own identifying information. (Don't include
191
- the brackets!) The text should be enclosed in the appropriate
192
- comment syntax for the file format. We also recommend that a
193
- file or class name and description of purpose be included on the
194
- same "printed page" as the copyright notice for easier
195
- identification within third-party archives.
196
-
197
- Copyright 2025 Snowflake
198
-
199
- Licensed under the Apache License, Version 2.0 (the "License");
200
- you may not use this file except in compliance with the License.
201
- You may obtain a copy of the License at
202
-
203
- http://www.apache.org/licenses/LICENSE-2.0
204
-
205
- Unless required by applicable law or agreed to in writing, software
206
- distributed under the License is distributed on an "AS IS" BASIS,
207
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
208
- See the License for the specific language governing permissions and
209
- limitations under the License.
210
- License-File: LICENSE
211
- Keywords: Snowflake,Snowpark,analytics,cloud,database,db
212
- Classifier: Development Status :: 4 - Beta
213
- Classifier: Environment :: Console
214
- Classifier: Environment :: Other Environment
215
- Classifier: Intended Audience :: Developers
216
- Classifier: Intended Audience :: Education
217
- Classifier: Intended Audience :: Information Technology
218
- Classifier: Intended Audience :: System Administrators
219
- Classifier: License :: OSI Approved :: Apache Software License
220
- Classifier: Operating System :: OS Independent
221
- Classifier: Programming Language :: Python :: 3 :: Only
222
- Classifier: Programming Language :: SQL
223
- Classifier: Topic :: Database
224
- Classifier: Topic :: Scientific/Engineering :: Information Analysis
225
- Classifier: Topic :: Software Development
226
- Classifier: Topic :: Software Development :: Libraries
227
- Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
228
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
229
- Requires-Python: >=3.9
230
- Requires-Dist: pydantic>=1.8.2
231
- Requires-Dist: snowflake-snowpark-python
232
- Provides-Extra: development
233
- Requires-Dist: coverage>=7.6.7; extra == 'development'
234
- Requires-Dist: hatchling==1.25.0; extra == 'development'
235
- Requires-Dist: pre-commit>=4.0.1; extra == 'development'
236
- Requires-Dist: pyarrow>=18.0.0; extra == 'development'
237
- Requires-Dist: pytest-cov>=6.0.0; extra == 'development'
238
- Requires-Dist: pytest>=8.3.3; extra == 'development'
239
- Requires-Dist: setuptools>=70.0.0; extra == 'development'
240
- Requires-Dist: twine==5.1.1; extra == 'development'
241
- Description-Content-Type: text/markdown
242
-
243
- # snowpark-checkpoints-configuration
244
-
245
- ---
246
- **NOTE**
247
-
248
- This package is on Private Preview.
249
-
250
- ---
251
-
252
- **snowpark-checkpoints-configuration** is a module for loading `checkpoint.json` and provides a model.
253
- This module will work automatically with *snowpark-checkpoints-collector* and *snowpark-checkpoints-validators*. This will try to read the configuration file from the current working directory.
254
-
255
- ## Usage
256
-
257
- To explicit load a file, you can import `CheckpointMetadata` and create an instance as shown below:
258
-
259
- ```python
260
- from snowflake.snowpark_checkpoints_configuration import CheckpointMetadata
261
-
262
- my_checkpoint_metadata = CheckpointMetadata("path/to/checkpoint.json")
263
-
264
- checkpoint_model = my_checkpoint_metadata.get("my_checkpoint_name")
265
- ...
266
- ```
267
- ------
@@ -1,4 +0,0 @@
1
- snowpark_checkpoints_configuration-0.2.0rc1.dist-info/METADATA,sha256=VWGHNDbGiJWd6SydDmdh5v0_FnF7Ym6f6D6y66_0bbE,15574
2
- snowpark_checkpoints_configuration-0.2.0rc1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
3
- snowpark_checkpoints_configuration-0.2.0rc1.dist-info/licenses/LICENSE,sha256=pmjhbh6uVhV5MBXOlou_UZgFP7CYVQITkCCdvfcS5lY,11340
4
- snowpark_checkpoints_configuration-0.2.0rc1.dist-info/RECORD,,