This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE MASKING POLICY hash_mask AS (val string) RETURNS string -> SHA2(val); | |
ALTER TABLE customer MODIFY COLUMN name SET MASKING POLICY hash_mask, | |
ALTER TABLE customer MODIFY COLUMN email SET MASKING POLICY hash_mask; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://json-schema.org/draft/2020-12/schema", | |
"$id": "https://example.com/customer/v1.json", | |
"type": "object", | |
"title": "Customer event", | |
"properties": { | |
"name": { | |
"type": "string", | |
"description": "Customer's full name", | |
"tags": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bad practice - max overwrites the built-in Python function: | |
from snowflake.snowpark.functions import max | |
# Recommended import style: | |
import snowflake.snowpark.functions as F | |
import snowflake.snowpark.types as T | |
# Or use an alias to import a single function | |
from snowflake.snowpark.functions import max as snf_max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e2etest-job: | |
stage: e2etest | |
only: | |
- branches | |
image: zyanakiev/snowpark-devops:latest | |
script: | |
- | | |
jq -c -r '.assertions[]' tests/e2e_tests.json | while read test; do | |
name=$(jq -r '.name' <<< $test) | |
sql=$(jq -r '.value' <<< $test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
release-model-job: | |
stage: release | |
image: zyanakiev/snowpark-devops:latest | |
artifacts: | |
name: model | |
when: on_success | |
paths: | |
- model_$CI_COMMIT_TAG.joblib | |
rules: | |
- if: $CI_COMMIT_TAG # Only on new tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
run-procedures-job: | |
stage: run-procedures | |
image: zyanakiev/snowpark-devops:latest | |
only: | |
- branches | |
script: | |
- | | |
echo "Run procedures" | |
~/bin/snowsql -s $SF_SCHEMA -f ./setup/01_run_procedures.sql -o friendly=false -o exit_on_error=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delete-schema-job: | |
stage: deploy | |
variables: | |
GIT_STRATEGY: none | |
environment: | |
name: $CI_COMMIT_REF_SLUG | |
action: stop | |
only: | |
- branches | |
image: zyanakiev/snowpark-devops:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
deploy-job: | |
stage: deploy | |
image: zyanakiev/snowpark-devops:latest | |
environment: | |
name: $CI_COMMIT_REF_SLUG | |
on_stop: delete-schema-job | |
only: | |
- branches | |
script: | |
- | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
build-job: | |
stage: build | |
image: zyanakiev/snowpark-devops:latest | |
artifacts: | |
name: app | |
untracked: false | |
when: on_success | |
expire_in: "7 days" | |
paths: | |
- "app.zip" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
schema-name-job: | |
stage: .pre | |
script: | |
- SF_SCHEMA="$(echo $CI_COMMIT_REF_NAME | sed -E 's/[^[:alnum:]]+/_/g')" | |
- echo "SF_SCHEMA=${SF_SCHEMA}" > variables.env | |
artifacts: | |
reports: | |
dotenv: variables.env |
NewerOlder