snowpark-checkpoints-validators 0.1.1__tar.gz → 0.1.3__tar.gz

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 (53) hide show
  1. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/.gitignore +1 -0
  2. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/PKG-INFO +4 -4
  3. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/README.md +1 -2
  4. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/pyproject.toml +7 -4
  5. snowpark_checkpoints_validators-0.1.3/src/snowflake/snowpark_checkpoints/__version__.py +16 -0
  6. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/src/snowflake/snowpark_checkpoints/utils/telemetry.py +3 -3
  7. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/src/snowflake/snowpark_checkpoints/utils/utils_checks.py +2 -0
  8. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/src/snowflake/snowpark_checkpoints/validation_result_metadata.py +9 -0
  9. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/telemetry_expected/df_mode_dataframe_mismatch_telemetry.json +5 -5
  10. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/telemetry_expected/df_mode_dataframe_telemetry.json +5 -5
  11. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/telemetry_expected/spark_checkpoint_df_fail_telemetry.json +5 -5
  12. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/telemetry_expected/spark_checkpoint_df_pass_telemetry.json +5 -5
  13. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/telemetry_expected/spark_checkpoint_limit_sample_telemetry.json +5 -5
  14. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/telemetry_expected/spark_checkpoint_random_sample_telemetry.json +5 -5
  15. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/telemetry_expected/spark_checkpoint_scalar_fail_telemetry.json +5 -5
  16. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/telemetry_expected/spark_checkpoint_scalar_passing_telemetry.json +5 -5
  17. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/telemetry_expected/test_df_check_custom_check_telemetry.json +5 -5
  18. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/telemetry_expected/test_df_check_fail_telemetry.json +5 -5
  19. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/telemetry_expected/test_df_check_from_file_telemetry.json +5 -5
  20. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/telemetry_expected/test_df_check_skip_check_telemetry.json +5 -5
  21. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/telemetry_expected/test_df_check_telemetry.json +5 -5
  22. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/telemetry_expected/test_input_fail_telemetry.json +5 -5
  23. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/telemetry_expected/test_input_telemetry.json +5 -5
  24. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/telemetry_expected/test_output_fail_telemetry.json +5 -5
  25. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/telemetry_expected/test_output_telemetry.json +5 -5
  26. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/unit/test_telemetry.py +2 -2
  27. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/unit/test_validation_result_metadata.py +41 -0
  28. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/CHANGELOG.md +0 -0
  29. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/LICENSE +0 -0
  30. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/src/snowflake/snowpark_checkpoints/__init__.py +0 -0
  31. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/src/snowflake/snowpark_checkpoints/checkpoint.py +0 -0
  32. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/src/snowflake/snowpark_checkpoints/errors.py +0 -0
  33. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/src/snowflake/snowpark_checkpoints/job_context.py +0 -0
  34. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/src/snowflake/snowpark_checkpoints/singleton.py +0 -0
  35. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/src/snowflake/snowpark_checkpoints/snowpark_sampler.py +0 -0
  36. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/src/snowflake/snowpark_checkpoints/spark_migration.py +0 -0
  37. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/src/snowflake/snowpark_checkpoints/utils/__init__.py +0 -0
  38. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/src/snowflake/snowpark_checkpoints/utils/checkpoint_logger.py +0 -0
  39. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/src/snowflake/snowpark_checkpoints/utils/constants.py +0 -0
  40. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/src/snowflake/snowpark_checkpoints/utils/extra_config.py +0 -0
  41. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/src/snowflake/snowpark_checkpoints/utils/pandera_check_manager.py +0 -0
  42. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/src/snowflake/snowpark_checkpoints/utils/supported_types.py +0 -0
  43. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/src/snowflake/snowpark_checkpoints/validation_results.py +0 -0
  44. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/.coveragerc +0 -0
  45. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/e2eexample.py +0 -0
  46. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/telemetry_compare_utils.py +0 -0
  47. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/test_pandera.py +0 -0
  48. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/test_parquet.py +0 -0
  49. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/integ/test_spark_checkpoint.py +0 -0
  50. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/unit/test_extra_config.py +0 -0
  51. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/unit/test_pandera_check_manager.py +0 -0
  52. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/unit/test_spark_migration.py +0 -0
  53. {snowpark_checkpoints_validators-0.1.1 → snowpark_checkpoints_validators-0.1.3}/test/unit/test_utils_checks.py +0 -0
@@ -13,6 +13,7 @@ wheelvenv/
13
13
 
14
14
  # version
15
15
  !__version__.py
16
+ !**/__version__.py
16
17
 
17
18
  #ruff
18
19
  .ruff_cache
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: snowpark-checkpoints-validators
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: Migration tools for Snowpark
5
5
  Project-URL: Bug Tracker, https://github.com/snowflakedb/snowpark-checkpoints/issues
6
6
  Project-URL: Source code, https://github.com/snowflakedb/snowpark-checkpoints/
@@ -29,10 +29,11 @@ Requires-Python: <3.12,>=3.9
29
29
  Requires-Dist: pandera-report==0.1.2
30
30
  Requires-Dist: pandera[io]==0.20.4
31
31
  Requires-Dist: pyspark
32
- Requires-Dist: snowflake-connector-python==3.13.0
32
+ Requires-Dist: snowflake-connector-python[pandas]
33
33
  Requires-Dist: snowflake-snowpark-python==1.26.0
34
34
  Provides-Extra: development
35
35
  Requires-Dist: coverage>=7.6.7; extra == 'development'
36
+ Requires-Dist: deepdiff==8.1.1; extra == 'development'
36
37
  Requires-Dist: deepdiff>=8.0.0; extra == 'development'
37
38
  Requires-Dist: hatchling==1.25.0; extra == 'development'
38
39
  Requires-Dist: pre-commit>=4.0.1; extra == 'development'
@@ -46,8 +47,7 @@ Description-Content-Type: text/markdown
46
47
  # snowpark-checkpoints-validators
47
48
 
48
49
  ---
49
- **NOTE**
50
- This package is on Public Preview.
50
+ ##### This package is on Public Preview.
51
51
  ---
52
52
 
53
53
  **snowpark-checkpoints-validators** is a package designed to validate Snowpark DataFrames against predefined schemas and checkpoints. This package ensures data integrity and consistency by performing schema and data validation checks at various stages of a Snowpark pipeline.
@@ -1,8 +1,7 @@
1
1
  # snowpark-checkpoints-validators
2
2
 
3
3
  ---
4
- **NOTE**
5
- This package is on Public Preview.
4
+ ##### This package is on Public Preview.
6
5
  ---
7
6
 
8
7
  **snowpark-checkpoints-validators** is a package designed to validate Snowpark DataFrames against predefined schemas and checkpoints. This package ensures data integrity and consistency by performing schema and data validation checks at various stages of a Snowpark pipeline.
@@ -27,7 +27,7 @@ classifiers = [
27
27
  ]
28
28
  dependencies = [
29
29
  "snowflake-snowpark-python==1.26.0",
30
- "snowflake-connector-python==3.13.0",
30
+ "snowflake-connector-python[pandas]",
31
31
  "pyspark",
32
32
  "pandera[io]==0.20.4",
33
33
  "pandera-report==0.1.2",
@@ -49,6 +49,7 @@ requires-python = '>=3.9,<3.12'
49
49
 
50
50
  [project.optional-dependencies]
51
51
  development = [
52
+ "deepdiff==8.1.1",
52
53
  "pytest>=8.3.3",
53
54
  "pytest-cov>=6.0.0",
54
55
  "coverage>=7.6.7",
@@ -65,7 +66,7 @@ development = [
65
66
  "Source code" = "https://github.com/snowflakedb/snowpark-checkpoints/"
66
67
 
67
68
  [tool.hatch.version]
68
- path = "__version__.py"
69
+ path = "src/snowflake/snowpark_checkpoints/__version__.py"
69
70
  pattern = '^__version__ = "(?P<version>.*)"'
70
71
  source = "regex"
71
72
 
@@ -127,8 +128,10 @@ check = [
127
128
 
128
129
  [tool.hatch.envs.test.scripts]
129
130
  check = [
130
- "pip install -e ../snowpark-checkpoints-configuration",
131
- 'pytest -v --junitxml=test/outcome/test-results.xml --cov=. --cov-config=test/.coveragerc --cov-report=xml:test/outcome/coverage-{matrix:python:{env:PYTHON_VERSION:unset}}.xml {args:test} --cov-report=term --cov-report=json:test/outcome/coverage-{matrix:python:{env:PYTHON_VERSION:unset}}.json',
131
+ 'python -m pip install --upgrade pip -q',
132
+ 'pip install -q -e ../snowpark-checkpoints-configuration',
133
+ 'pip list',
134
+ 'pytest -vvv --junitxml=test/outcome/test-results.xml --cov=. --cov-branch --cov-config=test/.coveragerc --cov-report=xml:test/outcome/coverage-{matrix:python:{env:PYTHON_VERSION:unset}}.xml {args:test} --cov-report=term --cov-report=html:test/outcome/coverage-{matrix:python:{env:PYTHON_VERSION:unset}}.html --cov-report=json:test/outcome/coverage-{matrix:python:{env:PYTHON_VERSION:unset}}.json',
132
135
  ]
133
136
 
134
137
  coverage = [
@@ -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.1.3"
@@ -330,11 +330,11 @@ def _generate_event(
330
330
  if sc_version is not None:
331
331
  metadata["snowpark_checkpoints_version"] = sc_version
332
332
  message = {
333
- "type": event_type,
333
+ "event_type": event_type,
334
+ "type": "snowpark-checkpoints",
334
335
  "event_name": event_name,
335
336
  "driver_type": "PythonConnector",
336
337
  "driver_version": SNOWFLAKE_CONNECTOR_VERSION,
337
- "source": "snowpark-checkpoints",
338
338
  "metadata": metadata,
339
339
  "data": json.dumps(parameters_info or {}),
340
340
  }
@@ -367,7 +367,7 @@ def _get_version() -> str:
367
367
 
368
368
  """
369
369
  try:
370
- directory_levels_up = 4
370
+ directory_levels_up = 1
371
371
  project_root = Path(__file__).resolve().parents[directory_levels_up]
372
372
  version_file_path = project_root / VERSION_FILE_NAME
373
373
  with open(version_file_path) as file:
@@ -359,6 +359,8 @@ def _update_validation_result(
359
359
 
360
360
  pipeline_result_metadata = ValidationResultsMetadata(output_path)
361
361
 
362
+ pipeline_result_metadata.clean()
363
+
362
364
  pipeline_result_metadata.add_validation_result(
363
365
  ValidationResult(
364
366
  timestamp=datetime.now().isoformat(),
@@ -88,6 +88,15 @@ class ValidationResultsMetadata(metaclass=Singleton):
88
88
  f"Error reading validation results file: {self.validation_results_file} \n {e}"
89
89
  ) from None
90
90
 
91
+ def clean(self):
92
+ """Clean the validation results list.
93
+
94
+ This method empties the validation results list.
95
+
96
+ """
97
+ if not os.path.exists(self.validation_results_file):
98
+ self.validation_results.results = []
99
+
91
100
  def add_validation_result(self, validation_result: ValidationResult):
92
101
  """Add a validation result to the pipeline result list.
93
102
 
@@ -4,15 +4,15 @@
4
4
  "driver_type": "PythonConnector",
5
5
  "driver_version": "3.12.4",
6
6
  "event_name": "DataFrame_Validator_DF",
7
+ "event_type": "info",
7
8
  "metadata": {
8
- "device_id": "0471186eb1a6ba58c82e97d19006a08b163bc0056c05e6f770090eade2c3a809",
9
+ "device_id": "a16562762b83c9f0b6ffa4649c0b6c20348ccfcf49d1144fc4c6557dd1c683ec",
9
10
  "os_version": "darwin",
10
11
  "python_version": "3.11.11",
11
- "snowpark_checkpoints_version": "0.1.0rc2",
12
+ "snowpark_checkpoints_version": "0.1.2",
12
13
  "snowpark_version": "1.26.0"
13
14
  },
14
- "source": "snowpark-checkpoints",
15
- "type": "info"
15
+ "type": "snowpark-checkpoints"
16
16
  },
17
- "timestamp": "1737735324401"
17
+ "timestamp": "1738949863608"
18
18
  }
@@ -4,15 +4,15 @@
4
4
  "driver_type": "PythonConnector",
5
5
  "driver_version": "3.12.4",
6
6
  "event_name": "DataFrame_Validator_DF",
7
+ "event_type": "info",
7
8
  "metadata": {
8
- "device_id": "0471186eb1a6ba58c82e97d19006a08b163bc0056c05e6f770090eade2c3a809",
9
+ "device_id": "a16562762b83c9f0b6ffa4649c0b6c20348ccfcf49d1144fc4c6557dd1c683ec",
9
10
  "os_version": "darwin",
10
11
  "python_version": "3.11.11",
11
- "snowpark_checkpoints_version": "0.1.0rc2",
12
+ "snowpark_checkpoints_version": "0.1.2",
12
13
  "snowpark_version": "1.26.0"
13
14
  },
14
- "source": "snowpark-checkpoints",
15
- "type": "info"
15
+ "type": "snowpark-checkpoints"
16
16
  },
17
- "timestamp": "1737735310567"
17
+ "timestamp": "1738949850430"
18
18
  }
@@ -4,15 +4,15 @@
4
4
  "driver_type": "PythonConnector",
5
5
  "driver_version": "3.12.4",
6
6
  "event_name": "DataFrame_Validator_Mirror",
7
+ "event_type": "info",
7
8
  "metadata": {
8
- "device_id": "0471186eb1a6ba58c82e97d19006a08b163bc0056c05e6f770090eade2c3a809",
9
+ "device_id": "a16562762b83c9f0b6ffa4649c0b6c20348ccfcf49d1144fc4c6557dd1c683ec",
9
10
  "os_version": "darwin",
10
11
  "python_version": "3.11.11",
11
- "snowpark_checkpoints_version": "0.1.0rc2",
12
+ "snowpark_checkpoints_version": "0.1.2",
12
13
  "snowpark_version": "1.26.0"
13
14
  },
14
- "source": "snowpark-checkpoints",
15
- "type": "info"
15
+ "type": "snowpark-checkpoints"
16
16
  },
17
- "timestamp": "1737735364779"
17
+ "timestamp": "1738949906510"
18
18
  }
@@ -4,15 +4,15 @@
4
4
  "driver_type": "PythonConnector",
5
5
  "driver_version": "3.12.4",
6
6
  "event_name": "DataFrame_Validator_Mirror",
7
+ "event_type": "info",
7
8
  "metadata": {
8
- "device_id": "0471186eb1a6ba58c82e97d19006a08b163bc0056c05e6f770090eade2c3a809",
9
+ "device_id": "a16562762b83c9f0b6ffa4649c0b6c20348ccfcf49d1144fc4c6557dd1c683ec",
9
10
  "os_version": "darwin",
10
11
  "python_version": "3.11.11",
11
- "snowpark_checkpoints_version": "0.1.0rc2",
12
+ "snowpark_checkpoints_version": "0.1.2",
12
13
  "snowpark_version": "1.26.0"
13
14
  },
14
- "source": "snowpark-checkpoints",
15
- "type": "info"
15
+ "type": "snowpark-checkpoints"
16
16
  },
17
- "timestamp": "1737735355423"
17
+ "timestamp": "1738949896738"
18
18
  }
@@ -4,15 +4,15 @@
4
4
  "driver_type": "PythonConnector",
5
5
  "driver_version": "3.12.4",
6
6
  "event_name": "DataFrame_Validator_Mirror",
7
+ "event_type": "info",
7
8
  "metadata": {
8
- "device_id": "0471186eb1a6ba58c82e97d19006a08b163bc0056c05e6f770090eade2c3a809",
9
+ "device_id": "a16562762b83c9f0b6ffa4649c0b6c20348ccfcf49d1144fc4c6557dd1c683ec",
9
10
  "os_version": "darwin",
10
11
  "python_version": "3.11.11",
11
- "snowpark_checkpoints_version": "0.1.0rc2",
12
+ "snowpark_checkpoints_version": "0.1.2",
12
13
  "snowpark_version": "1.26.0"
13
14
  },
14
- "source": "snowpark-checkpoints",
15
- "type": "info"
15
+ "type": "snowpark-checkpoints"
16
16
  },
17
- "timestamp": "1737735377920"
17
+ "timestamp": "1738949919619"
18
18
  }
@@ -4,15 +4,15 @@
4
4
  "driver_type": "PythonConnector",
5
5
  "driver_version": "3.12.4",
6
6
  "event_name": "DataFrame_Validator_Mirror",
7
+ "event_type": "info",
7
8
  "metadata": {
8
- "device_id": "0471186eb1a6ba58c82e97d19006a08b163bc0056c05e6f770090eade2c3a809",
9
+ "device_id": "a16562762b83c9f0b6ffa4649c0b6c20348ccfcf49d1144fc4c6557dd1c683ec",
9
10
  "os_version": "darwin",
10
11
  "python_version": "3.11.11",
11
- "snowpark_checkpoints_version": "0.1.0rc2",
12
+ "snowpark_checkpoints_version": "0.1.2",
12
13
  "snowpark_version": "1.26.0"
13
14
  },
14
- "source": "snowpark-checkpoints",
15
- "type": "info"
15
+ "type": "snowpark-checkpoints"
16
16
  },
17
- "timestamp": "1737735390162"
17
+ "timestamp": "1738949932552"
18
18
  }
@@ -4,15 +4,15 @@
4
4
  "driver_type": "PythonConnector",
5
5
  "driver_version": "3.12.4",
6
6
  "event_name": "Value_Validator_Mirror",
7
+ "event_type": "info",
7
8
  "metadata": {
8
- "device_id": "0471186eb1a6ba58c82e97d19006a08b163bc0056c05e6f770090eade2c3a809",
9
+ "device_id": "a16562762b83c9f0b6ffa4649c0b6c20348ccfcf49d1144fc4c6557dd1c683ec",
9
10
  "os_version": "darwin",
10
11
  "python_version": "3.11.11",
11
- "snowpark_checkpoints_version": "0.1.0rc2",
12
+ "snowpark_checkpoints_version": "0.1.2",
12
13
  "snowpark_version": "1.26.0"
13
14
  },
14
- "source": "snowpark-checkpoints",
15
- "type": "info"
15
+ "type": "snowpark-checkpoints"
16
16
  },
17
- "timestamp": "1737735346409"
17
+ "timestamp": "1738949887503"
18
18
  }
@@ -4,15 +4,15 @@
4
4
  "driver_type": "PythonConnector",
5
5
  "driver_version": "3.12.4",
6
6
  "event_name": "Value_Validator_Mirror",
7
+ "event_type": "info",
7
8
  "metadata": {
8
- "device_id": "0471186eb1a6ba58c82e97d19006a08b163bc0056c05e6f770090eade2c3a809",
9
+ "device_id": "a16562762b83c9f0b6ffa4649c0b6c20348ccfcf49d1144fc4c6557dd1c683ec",
9
10
  "os_version": "darwin",
10
11
  "python_version": "3.11.11",
11
- "snowpark_checkpoints_version": "0.1.0rc2",
12
+ "snowpark_checkpoints_version": "0.1.2",
12
13
  "snowpark_version": "1.26.0"
13
14
  },
14
- "source": "snowpark-checkpoints",
15
- "type": "info"
15
+ "type": "snowpark-checkpoints"
16
16
  },
17
- "timestamp": "1737735338015"
17
+ "timestamp": "1738949877793"
18
18
  }
@@ -4,15 +4,15 @@
4
4
  "driver_type": "PythonConnector",
5
5
  "driver_version": "3.12.4",
6
6
  "event_name": "DataFrame_Validator_Schema",
7
+ "event_type": "info",
7
8
  "metadata": {
8
- "device_id": "0471186eb1a6ba58c82e97d19006a08b163bc0056c05e6f770090eade2c3a809",
9
+ "device_id": "a16562762b83c9f0b6ffa4649c0b6c20348ccfcf49d1144fc4c6557dd1c683ec",
9
10
  "os_version": "darwin",
10
11
  "python_version": "3.11.11",
11
- "snowpark_checkpoints_version": "0.1.0rc2",
12
+ "snowpark_checkpoints_version": "0.1.2",
12
13
  "snowpark_version": "1.26.0"
13
14
  },
14
- "source": "snowpark-checkpoints",
15
- "type": "info"
15
+ "type": "snowpark-checkpoints"
16
16
  },
17
- "timestamp": "1737735301276"
17
+ "timestamp": "1738949840653"
18
18
  }
@@ -4,15 +4,15 @@
4
4
  "driver_type": "PythonConnector",
5
5
  "driver_version": "3.12.4",
6
6
  "event_name": "DataFrame_Validator_Schema",
7
+ "event_type": "error",
7
8
  "metadata": {
8
- "device_id": "0471186eb1a6ba58c82e97d19006a08b163bc0056c05e6f770090eade2c3a809",
9
+ "device_id": "a16562762b83c9f0b6ffa4649c0b6c20348ccfcf49d1144fc4c6557dd1c683ec",
9
10
  "os_version": "darwin",
10
11
  "python_version": "3.11.11",
11
- "snowpark_checkpoints_version": "0.1.0rc2",
12
+ "snowpark_checkpoints_version": "0.1.2",
12
13
  "snowpark_version": "1.26.0"
13
14
  },
14
- "source": "snowpark-checkpoints",
15
- "type": "error"
15
+ "type": "snowpark-checkpoints"
16
16
  },
17
- "timestamp": "1737735293272"
17
+ "timestamp": "1738949833418"
18
18
  }
@@ -4,15 +4,15 @@
4
4
  "driver_type": "PythonConnector",
5
5
  "driver_version": "3.12.4",
6
6
  "event_name": "DataFrame_Validator_Schema",
7
+ "event_type": "info",
7
8
  "metadata": {
8
- "device_id": "0471186eb1a6ba58c82e97d19006a08b163bc0056c05e6f770090eade2c3a809",
9
+ "device_id": "a16562762b83c9f0b6ffa4649c0b6c20348ccfcf49d1144fc4c6557dd1c683ec",
9
10
  "os_version": "darwin",
10
11
  "python_version": "3.11.11",
11
- "snowpark_checkpoints_version": "0.1.0rc2",
12
+ "snowpark_checkpoints_version": "0.1.2",
12
13
  "snowpark_version": "1.26.0"
13
14
  },
14
- "source": "snowpark-checkpoints",
15
- "type": "info"
15
+ "type": "snowpark-checkpoints"
16
16
  },
17
- "timestamp": "1737735297754"
17
+ "timestamp": "1738949837314"
18
18
  }
@@ -4,15 +4,15 @@
4
4
  "driver_type": "PythonConnector",
5
5
  "driver_version": "3.12.4",
6
6
  "event_name": "DataFrame_Validator_Schema",
7
+ "event_type": "info",
7
8
  "metadata": {
8
- "device_id": "0471186eb1a6ba58c82e97d19006a08b163bc0056c05e6f770090eade2c3a809",
9
+ "device_id": "a16562762b83c9f0b6ffa4649c0b6c20348ccfcf49d1144fc4c6557dd1c683ec",
9
10
  "os_version": "darwin",
10
11
  "python_version": "3.11.11",
11
- "snowpark_checkpoints_version": "0.1.0rc2",
12
+ "snowpark_checkpoints_version": "0.1.2",
12
13
  "snowpark_version": "1.26.0"
13
14
  },
14
- "source": "snowpark-checkpoints",
15
- "type": "info"
15
+ "type": "snowpark-checkpoints"
16
16
  },
17
- "timestamp": "1737735304913"
17
+ "timestamp": "1738949844915"
18
18
  }
@@ -4,15 +4,15 @@
4
4
  "driver_type": "PythonConnector",
5
5
  "driver_version": "3.12.4",
6
6
  "event_name": "DataFrame_Validator_Schema",
7
+ "event_type": "info",
7
8
  "metadata": {
8
- "device_id": "0471186eb1a6ba58c82e97d19006a08b163bc0056c05e6f770090eade2c3a809",
9
+ "device_id": "a16562762b83c9f0b6ffa4649c0b6c20348ccfcf49d1144fc4c6557dd1c683ec",
9
10
  "os_version": "darwin",
10
11
  "python_version": "3.11.11",
11
- "snowpark_checkpoints_version": "0.1.0rc2",
12
+ "snowpark_checkpoints_version": "0.1.2",
12
13
  "snowpark_version": "1.26.0"
13
14
  },
14
- "source": "snowpark-checkpoints",
15
- "type": "info"
15
+ "type": "snowpark-checkpoints"
16
16
  },
17
- "timestamp": "1737735289704"
17
+ "timestamp": "1738949829780"
18
18
  }
@@ -4,15 +4,15 @@
4
4
  "driver_type": "PythonConnector",
5
5
  "driver_version": "3.12.4",
6
6
  "event_name": "DataFrame_Validator_Schema",
7
+ "event_type": "info",
7
8
  "metadata": {
8
- "device_id": "0471186eb1a6ba58c82e97d19006a08b163bc0056c05e6f770090eade2c3a809",
9
+ "device_id": "a16562762b83c9f0b6ffa4649c0b6c20348ccfcf49d1144fc4c6557dd1c683ec",
9
10
  "os_version": "darwin",
10
11
  "python_version": "3.11.11",
11
- "snowpark_checkpoints_version": "0.1.0rc2",
12
+ "snowpark_checkpoints_version": "0.1.2",
12
13
  "snowpark_version": "1.26.0"
13
14
  },
14
- "source": "snowpark-checkpoints",
15
- "type": "info"
15
+ "type": "snowpark-checkpoints"
16
16
  },
17
- "timestamp": "1737735274936"
17
+ "timestamp": "1738949813722"
18
18
  }
@@ -4,15 +4,15 @@
4
4
  "driver_type": "PythonConnector",
5
5
  "driver_version": "3.12.4",
6
6
  "event_name": "DataFrame_Validator_Schema",
7
+ "event_type": "info",
7
8
  "metadata": {
8
- "device_id": "0471186eb1a6ba58c82e97d19006a08b163bc0056c05e6f770090eade2c3a809",
9
+ "device_id": "a16562762b83c9f0b6ffa4649c0b6c20348ccfcf49d1144fc4c6557dd1c683ec",
9
10
  "os_version": "darwin",
10
11
  "python_version": "3.11.11",
11
- "snowpark_checkpoints_version": "0.1.0rc2",
12
+ "snowpark_checkpoints_version": "0.1.2",
12
13
  "snowpark_version": "1.26.0"
13
14
  },
14
- "source": "snowpark-checkpoints",
15
- "type": "info"
15
+ "type": "snowpark-checkpoints"
16
16
  },
17
- "timestamp": "1737735270414"
17
+ "timestamp": "1738949808582"
18
18
  }
@@ -4,15 +4,15 @@
4
4
  "driver_type": "PythonConnector",
5
5
  "driver_version": "3.12.4",
6
6
  "event_name": "DataFrame_Validator_Schema",
7
+ "event_type": "info",
7
8
  "metadata": {
8
- "device_id": "0471186eb1a6ba58c82e97d19006a08b163bc0056c05e6f770090eade2c3a809",
9
+ "device_id": "a16562762b83c9f0b6ffa4649c0b6c20348ccfcf49d1144fc4c6557dd1c683ec",
9
10
  "os_version": "darwin",
10
11
  "python_version": "3.11.11",
11
- "snowpark_checkpoints_version": "0.1.0rc2",
12
+ "snowpark_checkpoints_version": "0.1.2",
12
13
  "snowpark_version": "1.26.0"
13
14
  },
14
- "source": "snowpark-checkpoints",
15
- "type": "info"
15
+ "type": "snowpark-checkpoints"
16
16
  },
17
- "timestamp": "1737735282551"
17
+ "timestamp": "1738949821944"
18
18
  }
@@ -4,15 +4,15 @@
4
4
  "driver_type": "PythonConnector",
5
5
  "driver_version": "3.12.4",
6
6
  "event_name": "DataFrame_Validator_Schema",
7
+ "event_type": "info",
7
8
  "metadata": {
8
- "device_id": "0471186eb1a6ba58c82e97d19006a08b163bc0056c05e6f770090eade2c3a809",
9
+ "device_id": "a16562762b83c9f0b6ffa4649c0b6c20348ccfcf49d1144fc4c6557dd1c683ec",
9
10
  "os_version": "darwin",
10
11
  "python_version": "3.11.11",
11
- "snowpark_checkpoints_version": "0.1.0rc2",
12
+ "snowpark_checkpoints_version": "0.1.2",
12
13
  "snowpark_version": "1.26.0"
13
14
  },
14
- "source": "snowpark-checkpoints",
15
- "type": "info"
15
+ "type": "snowpark-checkpoints"
16
16
  },
17
- "timestamp": "1737735278854"
17
+ "timestamp": "1738949817624"
18
18
  }
@@ -252,10 +252,10 @@ class TelemetryManagerTest(unittest.TestCase):
252
252
  )
253
253
 
254
254
  # Assert
255
- assert result.get("message").get("type") == "event_type"
255
+ assert result.get("message").get("event_type") == "event_type"
256
256
  assert result.get("message").get("event_name") == "event_name"
257
257
  assert result.get("message").get("driver_type") == "PythonConnector"
258
- assert result.get("message").get("source") == "snowpark-checkpoints"
258
+ assert result.get("message").get("type") == "snowpark-checkpoints"
259
259
  assert result.get("message").get("metadata") == {
260
260
  "snowpark_checkpoints_version": snowpark_checkpoints_version
261
261
  }
@@ -127,3 +127,44 @@ def test_save_creates_directory():
127
127
  metadata.save()
128
128
 
129
129
  mock_makedirs.assert_called_once_with(metadata.validation_results_directory)
130
+
131
+
132
+ def test_clean_with_existing_file():
133
+ test_path = os.path.dirname(os.path.abspath(__file__))
134
+ result_path = os.path.join(
135
+ test_path,
136
+ SNOWPARK_CHECKPOINTS_OUTPUT_DIRECTORY_NAME,
137
+ VALIDATION_RESULTS_JSON_FILE_NAME,
138
+ )
139
+ with open(result_path) as file:
140
+ validation_result_json = file.read()
141
+ mock_validation_results = ValidationResults.model_validate_json(
142
+ validation_result_json
143
+ )
144
+
145
+ metadata = ValidationResultsMetadata(test_path)
146
+ metadata.validation_results = mock_validation_results
147
+
148
+ with patch("os.path.exists", return_value=True):
149
+ metadata.clean()
150
+
151
+ assert metadata.validation_results == mock_validation_results
152
+
153
+
154
+ def test_clean_with_no_file():
155
+ test_path = os.path.dirname(os.path.abspath(__file__))
156
+ metadata = ValidationResultsMetadata(test_path)
157
+
158
+ new_validation_result = ValidationResult(
159
+ timestamp="2021-01-01T00:00:00",
160
+ file="file2",
161
+ line_of_code=1,
162
+ result=PASS_STATUS,
163
+ checkpoint_name="checkpoint2",
164
+ )
165
+ metadata.add_validation_result(new_validation_result)
166
+
167
+ with patch("os.path.exists", return_value=False):
168
+ metadata.clean()
169
+
170
+ assert metadata.validation_results == ValidationResults(results=[])