snowpark-checkpoints-validators 0.1.0rc1__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,446 @@
1
+ Metadata-Version: 2.4
2
+ Name: snowpark-checkpoints-validators
3
+ Version: 0.1.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.12,>=3.9
230
+ Requires-Dist: pandera-report==0.1.2
231
+ Requires-Dist: pandera[io]==0.20.4
232
+ Requires-Dist: pyspark
233
+ Requires-Dist: snowflake-connector-python
234
+ Requires-Dist: snowflake-snowpark-python
235
+ Provides-Extra: development
236
+ Requires-Dist: coverage>=7.6.7; extra == 'development'
237
+ Requires-Dist: deepdiff>=8.0.0; extra == 'development'
238
+ Requires-Dist: hatchling==1.25.0; extra == 'development'
239
+ Requires-Dist: pre-commit>=4.0.1; extra == 'development'
240
+ Requires-Dist: pyarrow>=18.0.0; extra == 'development'
241
+ Requires-Dist: pytest-cov>=6.0.0; extra == 'development'
242
+ Requires-Dist: pytest>=8.3.3; extra == 'development'
243
+ Requires-Dist: setuptools>=70.0.0; extra == 'development'
244
+ Requires-Dist: twine==5.1.1; extra == 'development'
245
+ Description-Content-Type: text/markdown
246
+
247
+ # Snowpark Checkpoints Validators
248
+
249
+ ---
250
+ **NOTE**
251
+
252
+ This package is on Private Preview.
253
+
254
+ ---
255
+
256
+ **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.
257
+
258
+ ## Features
259
+
260
+ - Validate Snowpark DataFrames against predefined Pandera schemas.
261
+ - Perform custom checks and skip specific checks as needed.
262
+ - Generate validation results and log them for further analysis.
263
+ - Support for sampling strategies to validate large datasets efficiently.
264
+ - Integration with PySpark for cross-validation between Snowpark and PySpark DataFrames.
265
+
266
+ ## Functionalities
267
+
268
+ ### Validate DataFrame Schema from File
269
+
270
+ The `validate_dataframe_checkpoint` function validates a Snowpark DataFrame against a checkpoint schema file or dataframe.
271
+
272
+ ```python
273
+ from snowflake.snowpark_checkpoints.checkpoint import validate_dataframe_checkpoint
274
+
275
+ validate_dataframe_checkpoint(
276
+ df: SnowparkDataFrame,
277
+ checkpoint_name: str,
278
+ job_context: Optional[SnowparkJobContext] = None,
279
+ mode: Optional[CheckpointMode] = CheckpointMode.SCHEMA,
280
+ custom_checks: Optional[dict[Any, Any]] = None,
281
+ skip_checks: Optional[dict[Any, Any]] = None,
282
+ sample_frac: Optional[float] = 1.0,
283
+ sample_number: Optional[int] = None,
284
+ sampling_strategy: Optional[SamplingStrategy] = SamplingStrategy.RANDOM_SAMPLE,
285
+ output_path: Optional[str] = None,
286
+ )
287
+ ```
288
+
289
+ - `df`: Snowpark DataFrame to validate.
290
+ - `checkpoint_name`: Name of the checkpoint schema file or DataFrame.
291
+ - `job_context`: Snowpark job context.
292
+ - `mode`: Checkpoint mode (schema or data).
293
+ - `custom_checks`: Custom checks to perform.
294
+ - `skip_checks`: Checks to skip.
295
+ - `sample_frac`: Fraction of the DataFrame to sample.
296
+ - `sample_number`: Number of rows to sample.
297
+ - `sampling_strategy`: Sampling strategy to use.
298
+ - `output_path`: Output path for the checkpoint report.
299
+
300
+ ### Usage Example
301
+
302
+ ```python
303
+ from snowflake.snowpark import Session
304
+ from snowflake.snowpark import DataFrame as SnowparkDataFrame
305
+ from snowflake.snowpark_checkpoints.checkpoint import validate_dataframe_checkpoint
306
+
307
+ session = Session.builder.getOrCreate()
308
+ df = session.read.format("csv").load("data.csv")
309
+
310
+ validate_dataframe_checkpoint(
311
+ df,
312
+ "schema_checkpoint",
313
+ job_context=session,
314
+ mode=CheckpointMode.SCHEMA,
315
+ sample_frac=0.1,
316
+ sampling_strategy=SamplingStrategy.RANDOM_SAMPLE
317
+ )
318
+ ```
319
+
320
+ ### Check with Spark Decorator
321
+
322
+ The `check_with_spark` decorator converts any Snowpark DataFrame arguments to a function, samples them, and converts them to PySpark DataFrames. It then executes a provided Spark function and compares the outputs between the two implementations.
323
+
324
+ ```python
325
+ from snowflake.snowpark_checkpoints.spark_migration import check_with_spark
326
+
327
+ @check_with_spark(
328
+ job_context: Optional[SnowparkJobContext],
329
+ spark_function: Callable,
330
+ checkpoint_name: str,
331
+ sample_number: Optional[int] = 100,
332
+ sampling_strategy: Optional[SamplingStrategy] = SamplingStrategy.RANDOM_SAMPLE,
333
+ check_dtypes: Optional[bool] = False,
334
+ check_with_precision: Optional[bool] = False,
335
+ output_path: Optional[str] = None,
336
+ )
337
+ def snowpark_fn(df: SnowparkDataFrame):
338
+ ...
339
+ ```
340
+
341
+ - `job_context`: Snowpark job context.
342
+ - `spark_function`: PySpark function to execute.
343
+ - `checkpoint_name`: Name of the check.
344
+ - `sample_number`: Number of rows to sample.
345
+ - `sampling_strategy`: Sampling strategy to use.
346
+ - `check_dtypes`: Check data types.
347
+ - `check_with_precision`: Check with precision.
348
+ - `output_path`: Output path for the checkpoint report.
349
+
350
+ ### Usage Example
351
+
352
+ ```python
353
+ from snowflake.snowpark import Session
354
+ from snowflake.snowpark import DataFrame as SnowparkDataFrame
355
+ from snowflake.snowpark_checkpoints.spark_migration import check_with_spark
356
+
357
+ session = Session.builder.getOrCreate()
358
+ df = session.read.format("csv").load("data.csv")
359
+
360
+ @check_with_spark(
361
+ job_context=session,
362
+ spark_function=lambda df: df.withColumn("COLUMN1", df["COLUMN1"] + 1),
363
+ checkpoint_name="Check_Column1_Increment",
364
+ sample_number=100,
365
+ sampling_strategy=SamplingStrategy.RANDOM_SAMPLE,
366
+ )
367
+ def increment_column1(df: SnowparkDataFrame):
368
+ return df.with_column("COLUMN1", df["COLUMN1"] + 1)
369
+
370
+ increment_column1(df)
371
+ ```
372
+
373
+ ### Pandera Snowpark Decorators
374
+
375
+ The decorators `@check_input_schema` and `@check_output_schema` allow for sampled schema validation of Snowpark DataFrames in the input arguments or in the return value.
376
+
377
+ ```python
378
+ from snowflake.snowpark_checkpoints.checkpoint import check_input_schema, check_output_schema
379
+
380
+ @check_input_schema(
381
+ pandera_schema: DataFrameSchema,
382
+ checkpoint_name: str,
383
+ sample_frac: Optional[float] = 1.0,
384
+ sample_number: Optional[int] = None,
385
+ sampling_strategy: Optional[SamplingStrategy] = SamplingStrategy.RANDOM_SAMPLE,
386
+ job_context: Optional[SnowparkJobContext],
387
+ output_path: Optional[str] = None,
388
+ )
389
+ def snowpark_fn(df: SnowparkDataFrame):
390
+ ...
391
+
392
+ @check_output_schema(
393
+ pandera_schema: DataFrameSchema,
394
+ checkpoint_name: str,
395
+ sample_frac: Optional[float] = 1.0,
396
+ sample_number: Optional[int] = None,
397
+ sampling_strategy: Optional[SamplingStrategy] = SamplingStrategy.RANDOM_SAMPLE,
398
+ job_context: Optional[SnowparkJobContext],
399
+ output_path: Optional[str] = None,
400
+ )
401
+ def snowpark_fn(df: SnowparkDataFrame):
402
+ ...
403
+ ```
404
+
405
+ - `pandera_schema`: Pandera schema to validate.
406
+ - `checkpoint_name`: Name of the checkpoint schema file or DataFrame.
407
+ - `sample_frac`: Fraction of the DataFrame to sample.
408
+ - `sample_number`: Number of rows to sample.
409
+ - `sampling_strategy`: Sampling strategy to use.
410
+ - `job_context`: Snowpark job context.
411
+ - `output_path`: Output path for the checkpoint report.
412
+
413
+ ### Usage Example
414
+
415
+ The following will result in a Pandera `SchemaError`:
416
+
417
+ ```python
418
+ from pandas import DataFrame as PandasDataFrame
419
+ from pandera import DataFrameSchema, Column, Check
420
+ from snowflake.snowpark import Session
421
+ from snowflake.snowpark import DataFrame as SnowparkDataFrame
422
+ from snowflake.snowpark_checkpoints.checkpoint import check_output_schema
423
+
424
+ df = PandasDataFrame({
425
+ "COLUMN1": [1, 4, 0, 10, 9],
426
+ "COLUMN2": [-1.3, -1.4, -2.9, -10.1, -20.4],
427
+ })
428
+
429
+ out_schema = DataFrameSchema({
430
+ "COLUMN1": Column(int8, Check(lambda x: 0 <= x <= 10, element_wise=True)),
431
+ "COLUMN2": Column(float, Check(lambda x: x < -1.2)),
432
+ })
433
+
434
+ @check_output_schema(out_schema, "output_schema_checkpoint")
435
+ def preprocessor(dataframe: SnowparkDataFrame):
436
+ return dataframe.with_column("COLUMN1", lit('Some bad data yo'))
437
+
438
+ session = Session.builder.getOrCreate()
439
+ sp_dataframe = session.create_dataframe(df)
440
+
441
+ preprocessed_dataframe = preprocessor(sp_dataframe)
442
+ ```
443
+
444
+ ## License
445
+
446
+ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.
@@ -0,0 +1,4 @@
1
+ snowpark_checkpoints_validators-0.1.0rc1.dist-info/METADATA,sha256=emH8WmKPQHTC4KVL-L9Uqi6USzzWwFuDRT7-AmeCVJo,21852
2
+ snowpark_checkpoints_validators-0.1.0rc1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
3
+ snowpark_checkpoints_validators-0.1.0rc1.dist-info/licenses/LICENSE,sha256=pmjhbh6uVhV5MBXOlou_UZgFP7CYVQITkCCdvfcS5lY,11340
4
+ snowpark_checkpoints_validators-0.1.0rc1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.27.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent 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
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
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.