Skip to content

Commit 11d8fe1

Browse files
chore: use python3.11 for warehouse-transforms.
1 parent 9a4e0b5 commit 11d8fe1

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

dataeng/resources/warehouse-transforms-ci.sh

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env bash
22
set -ex
33

4-
# Creating python 3.8 virtual environment to run dbt warehouse-transform job
5-
PYTHON38_VENV="py38_venv"
6-
virtualenv --python=python3.8 --clear "${PYTHON38_VENV}"
7-
source "${PYTHON38_VENV}/bin/activate"
4+
# Creating python 3.11 virtual environment to run dbt warehouse-transform job
5+
PYTHON311_VENV="py311_venv"
6+
virtualenv --python=python3.11 --clear "${PYTHON311_VENV}"
7+
source "${PYTHON311_VENV}/bin/activate"
88

99
# Setup to run python script to create snowflake schema
1010
cd $WORKSPACE/analytics-tools/snowflake
@@ -48,8 +48,8 @@ then
4848
# Schema_Name will be the Github Pull Request ID e.g. 1724 prefixed with 'PR_*' and sufixed with project name e.g. PR_1724_reporting
4949
export CI_SCHEMA_NAME=PR_${ghprbPullId}_reporting
5050
# Schema is dynamically created against each PR. It is the PR number with 'PR_*' as prefixed.
51-
# profiles.yml contains the name of Schema which is used to create output models when dbt runs.
52-
python create_ci_schema.py --key_path $KEY_PATH --passphrase_path $PASSPHRASE_PATH --automation_user $USER --account $ACCOUNT --db_name $DB_NAME --schema_name $CI_SCHEMA_NAME
51+
# profiles.yml contains the name of Schema which is used to create output models when dbt runs.
52+
python create_ci_schema.py --key_path $KEY_PATH --passphrase_path $PASSPHRASE_PATH --automation_user $USER --account $ACCOUNT --db_name $DB_NAME --schema_name $CI_SCHEMA_NAME
5353
# create_ci_schema python script not just create schema but also drops the schema if it exists already, and the reason for doing so is if dbt model changes tables that are
5454
# created in seed job it will fail, so dropping those tables or deleting the whole schema is important to avoid such failure. We noticed while create_ci_schema being running
5555
# the dbt commands below starts running as they were using different sessions (warehouse and users), in order to complete the drop and create operation before running dbt adding sleep
@@ -60,12 +60,12 @@ then
6060
DBT_RUN_EXCLUDE='' ## Add excluded models here if any
6161
# This is a Slim CI syntax used to "test" only modified and downstream models
6262
DBT_TEST_OPTIONS="-m state:modified+ --defer --state $WORKSPACE/manifest"
63-
DBT_TEST_EXCLUDE='--exclude test_name:relationships'
63+
DBT_TEST_EXCLUDE='--exclude test_name:relationships'
6464

6565
source $WORKSPACE/jenkins-job-dsl/dataeng/resources/warehouse-transforms-ci-dbt.sh
6666

6767
cd $WORKSPACE/analytics-tools/snowflake
68-
python remove_ci_schema.py --key_path $KEY_PATH --passphrase_path $PASSPHRASE_PATH --automation_user $USER --account $ACCOUNT --db_name $DB_NAME --schema_name $CI_SCHEMA_NAME
68+
python remove_ci_schema.py --key_path $KEY_PATH --passphrase_path $PASSPHRASE_PATH --automation_user $USER --account $ACCOUNT --db_name $DB_NAME --schema_name $CI_SCHEMA_NAME
6969

7070
fi
7171

@@ -88,7 +88,7 @@ then
8888
cd $WORKSPACE/analytics-tools/snowflake
8989
python remove_ci_schema.py --key_path $KEY_PATH --passphrase_path $PASSPHRASE_PATH --automation_user $USER --account $ACCOUNT --db_name $DB_NAME --schema_name $CI_SCHEMA_NAME
9090

91-
91+
9292
fi
9393

9494
if [ "$isRawToSource" == "true" ]

dataeng/resources/warehouse-transforms.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env bash
22
set -ex
33

4-
# Creating python 3.8 virtual environment to run dbt warehouse-transform job
5-
PYTHON38_VENV="py38_venv"
6-
virtualenv --python=python3.8 --clear "${PYTHON38_VENV}"
7-
source "${PYTHON38_VENV}/bin/activate"
4+
# Creating python 3.11 virtual environment to run dbt warehouse-transform job
5+
PYTHON311_VENV="py311_venv"
6+
virtualenv --python=python3.11 --clear "${PYTHON311_VENV}"
7+
source "${PYTHON311_VENV}/bin/activate"
88

99
# Setup
1010
cd $WORKSPACE/warehouse-transforms

0 commit comments

Comments
 (0)