Skip to content

Commit a0160c1

Browse files
SNOW-1857047: Timeout issues on lambda (#2337)
1 parent ad78fe3 commit a0160c1

File tree

115 files changed

+5792
-584
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+5792
-584
lines changed

.github/workflows/build_test.yml

Lines changed: 373 additions & 11 deletions
Large diffs are not rendered by default.
Binary file not shown.
1.37 KB
Binary file not shown.
Binary file not shown.

DESCRIPTION.md

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,46 @@ https://docs.snowflake.com/
77
Source code is also available at: https://github.com/snowflakedb/snowflake-connector-python
88

99
# Release Notes
10-
- v3.14.1(TBD)
10+
- v3.16(TBD)
11+
- Bumped numpy dependency from <2.1.0 to <=2.2.4
12+
- Added Windows support for Python 3.13.
13+
14+
- v3.15.1(May 20, 2025)
15+
- Added basic arrow support for Interval types.
16+
- Fix `write_pandas` special characters usage in the location name.
17+
- Fix usage of `use_virtual_url` when building the location for gcs storage client.
18+
- Bind cryptography to <=44.0.3 to avoid issues with 45.0.0.
19+
20+
- v3.15.0(Apr 29,2025)
21+
- Bumped up min boto and botocore version to 1.24.
22+
- OCSP: terminate certificates chain traversal if a trusted certificate already reached.
23+
- Added new authentication methods support for programmatic access tokens (PATs), OAuth 2.0 Authorization Code Flow, OAuth 2.0 Client Credentials Flow, and OAuth Token caching.
24+
- For OAuth 2.0 Authorization Code Flow:
25+
- Added the `oauth_client_id`, `oauth_client_secret`, `oauth_authorization_url`, `oauth_token_request_url`, `oauth_redirect_uri`, `oauth_scope`, `oauth_disable_pkce`, `oauth_enable_refresh_tokens` and `oauth_enable_single_use_refresh_tokens` parameters.
26+
- Added the `OAUTH_AUTHORIZATION_CODE` value for the parameter authenticator.
27+
- For OAuth 2.0 Client Credentials Flow:
28+
- Added the `oauth_client_id`, `oauth_client_secret`, `oauth_token_request_url`, and `oauth_scope` parameters.
29+
- Added the `OAUTH_CLIENT_CREDENTIALS` value for the parameter authenticator.
30+
- For OAuth Token caching: Passing a username to driver configuration is required, and the `client_store_temporary_credential property` is to be set to `true`.
31+
32+
- v3.14.1(April 21, 2025)
1133
- Added support for Python 3.13.
1234
- NOTE: Windows 64 support is still experimental and should not yet be used for production environments.
1335
- Dropped support for Python 3.8.
14-
- Basic decimal floating-point type support.
15-
- Added handling of PAT provided in `password` field.
16-
- Improved error message for client-side query cancellations due to timeouts.
36+
- Added basic decimal floating-point type support.
37+
- Added experimental authentication methods.
1738
- Added support of GCS regional endpoints.
18-
- Added `gcs_use_virtual_endpoints` connection property that forces the usage of the virtual GCS usage. Thanks to this it should be possible to set up private DNS entry for the GCS endpoint. See more: https://cloud.google.com/storage/docs/request-endpoints#xml-api
19-
- Fixed a bug that caused driver to fail silently on `TO_DATE` arrow to python conversion when invalid date was followed by the correct one.
39+
- Added support of GCS virtual urls. See more: https://cloud.google.com/storage/docs/request-endpoints#xml-api
40+
- Added `client_fetch_threads` experimental parameter to better utilize threads for fetching query results.
2041
- Added `check_arrow_conversion_error_on_every_column` connection property that can be set to `False` to restore previous behaviour in which driver will ignore errors until it occurs in the last column. This flag's purpose is to unblock workflows that may be impacted by the bugfix and will be removed in later releases.
21-
- Lower log levels from info to debug for some of the messages to make the output easier to follow.
22-
- Allow the connector to inherit a UUID4 generated upstream, provided in statement parameters (field: `requestId`), rather than automatically generate a UUID4 to use for the HTTP Request ID.
42+
- Lowered log levels from info to debug for some of the messages to make the output easier to follow.
43+
- Allowed the connector to inherit a UUID4 generated upstream, provided in statement parameters (field: `requestId`), rather than automatically generate a UUID4 to use for the HTTP Request ID.
2344
- Improved logging in urllib3, boto3, botocore - assured data masking even after migration to the external owned library in the future.
45+
- Improved error message for client-side query cancellations due to timeouts.
46+
- Improved security and robustness for the temporary credentials cache storage.
47+
- Fixed a bug that caused driver to fail silently on `TO_DATE` arrow to python conversion when invalid date was followed by the correct one.
48+
- Fixed expired S3 credentials update and increment retry when expired credentials are found.
49+
- Deprecated `insecure_mode` connection property and replaced it with `disable_ocsp_checks` with the same behavior as the former property.
2450

2551
- v3.14.0(March 03, 2025)
2652
- Bumped pyOpenSSL dependency upper boundary from <25.0.0 to <26.0.0.
@@ -32,7 +58,6 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne
3258
- Fixed a bug where file permission check happened on Windows.
3359
- Added support for File types.
3460
- Added `unsafe_file_write` connection parameter that restores the previous behaviour of saving files downloaded with GET with 644 permissions.
35-
- Deprecated `insecure_mode` connection property and replaced it with `disable_ocsp_checks` with the same behavior as the former property.
3661

3762
- v3.13.2(January 29, 2025)
3863
- Changed not to use scoped temporary objects.

Jenkinsfile

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,46 @@ timestamps {
3535
string(name: 'parent_job', value: env.JOB_NAME),
3636
string(name: 'parent_build_number', value: env.BUILD_NUMBER)
3737
]
38-
stage('Test') {
39-
try {
40-
def commit_hash = "main" // default which we want to override
41-
def bptp_tag = "bptp-built"
42-
def response = authenticatedGithubCall("https://api.github.com/repos/snowflakedb/snowflake/git/ref/tags/${bptp_tag}")
43-
commit_hash = response.object.sha
44-
// Append the bptp-built commit sha to params
45-
params += [string(name: 'svn_revision', value: commit_hash)]
46-
} catch(Exception e) {
47-
println("Exception computing commit hash from: ${response}")
38+
parallel(
39+
'Test': {
40+
stage('Test') {
41+
try {
42+
def commit_hash = "main" // default which we want to override
43+
def bptp_tag = "bptp-stable"
44+
def response = authenticatedGithubCall("https://api.github.com/repos/snowflakedb/snowflake/git/ref/tags/${bptp_tag}")
45+
commit_hash = response.object.sha
46+
// Append the bptp-stable commit sha to params
47+
params += [string(name: 'svn_revision', value: commit_hash)]
48+
} catch(Exception e) {
49+
println("Exception computing commit hash from: ${response}")
50+
}
51+
parallel (
52+
'Test Python 39': { build job: 'RT-PyConnector39-PC',parameters: params},
53+
'Test Python 310': { build job: 'RT-PyConnector310-PC',parameters: params},
54+
'Test Python 311': { build job: 'RT-PyConnector311-PC',parameters: params},
55+
'Test Python 312': { build job: 'RT-PyConnector312-PC',parameters: params},
56+
'Test Python 313': { build job: 'RT-PyConnector313-PC',parameters: params},
57+
'Test Python 39 OldDriver': { build job: 'RT-PyConnector39-OldDriver-PC',parameters: params},
58+
'Test Python 39 FIPS': { build job: 'RT-FIPS-PyConnector39',parameters: params},
59+
)
60+
}
61+
},
62+
'Test Authentication': {
63+
stage('Test Authentication') {
64+
withCredentials([
65+
string(credentialsId: 'a791118f-a1ea-46cd-b876-56da1b9bc71c', variable: 'NEXUS_PASSWORD'),
66+
string(credentialsId: 'sfctest0-parameters-secret', variable: 'PARAMETERS_SECRET')
67+
]) {
68+
sh '''\
69+
|#!/bin/bash -e
70+
|$WORKSPACE/ci/test_authentication.sh
71+
'''.stripMargin()
4872
}
49-
parallel (
50-
'Test Python 39': { build job: 'RT-PyConnector39-PC',parameters: params},
51-
'Test Python 310': { build job: 'RT-PyConnector310-PC',parameters: params},
52-
'Test Python 311': { build job: 'RT-PyConnector311-PC',parameters: params},
53-
'Test Python 312': { build job: 'RT-PyConnector312-PC',parameters: params},
54-
'Test Python 313': { build job: 'RT-PyConnector313-PC',parameters: params},
55-
'Test Python 39 OldDriver': { build job: 'RT-PyConnector39-OldDriver-PC',parameters: params},
56-
'Test Python 39 FIPS': { build job: 'RT-FIPS-PyConnector39',parameters: params},
57-
)
5873
}
5974
}
60-
}
75+
)
76+
}
77+
}
6178

6279

6380
pipeline {

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ exclude tox.ini
2424
exclude mypy.ini
2525
exclude .clang-format
2626
exclude .wiremock/*
27+
exclude cmd/prober/testing_matrix.json
2728

2829
prune ci
2930
prune benchmark
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash -e
2+
3+
set -o pipefail
4+
5+
6+
export WORKSPACE=${WORKSPACE:-/mnt/workspace}
7+
export SOURCE_ROOT=${SOURCE_ROOT:-/mnt/host}
8+
9+
MVNW_EXE=$SOURCE_ROOT/mvnw
10+
AUTH_PARAMETER_FILE=./.github/workflows/parameters/private/parameters_aws_auth_tests.json
11+
eval $(jq -r '.authtestparams | to_entries | map("export \(.key)=\(.value|tostring)")|.[]' $AUTH_PARAMETER_FILE)
12+
13+
export SNOWFLAKE_AUTH_TEST_PRIVATE_KEY_PATH=./.github/workflows/parameters/private/rsa_keys/rsa_key.p8
14+
export SNOWFLAKE_AUTH_TEST_INVALID_PRIVATE_KEY_PATH=./.github/workflows/parameters/private/rsa_keys/rsa_key_invalid.p8
15+
16+
export SF_OCSP_TEST_MODE=true
17+
export SF_ENABLE_EXPERIMENTAL_AUTHENTICATION=true
18+
export RUN_AUTH_TESTS=true
19+
export AUTHENTICATION_TESTS_ENV="docker"
20+
export PYTHONPATH=$SOURCE_ROOT
21+
22+
python3 -m pip install --break-system-packages -e .
23+
24+
python3 -m pytest test/auth/*

ci/docker/connector_test/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ FROM $BASE_IMAGE
33

44
RUN yum install -y java-11-openjdk
55

6-
# TODO: When there are prebuilt wheels accessible for our dependencies (i.e. numpy)
7-
# for Python 3.13 this rust cargo install command can be removed.
6+
# Our dependencies rely on the Rust toolchain being available in the build-time environment (https://github.com/pyca/cryptography/issues/5771)
87
RUN yum -y install rust cargo
98

109
# This is to solve permission issue, read https://denibertovic.com/posts/handling-permissions-with-docker-volumes/

ci/docker/connector_test_lambda/Dockerfile313

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,13 @@ FROM public.ecr.aws/lambda/python:3.13-x86_64
22

33
WORKDIR /home/user/snowflake-connector-python
44

5-
# TODO: When there are prebuilt wheels accessible for our dependencies (i.e. numpy)
6-
# for Python 3.13 all dnf ... commands installing building kits can be removed.
7-
8-
# Install necessary packages and compilers - we need to build numpy for newer version
9-
# Update dnf and install development tools
105
RUN dnf -y update && \
11-
dnf -y install \
12-
gcc \
13-
gcc-c++ \
14-
make \
15-
python3-devel \
16-
openblas-devel \
17-
lapack-devel && \
186
dnf clean all
7+
8+
# Our dependencies rely on the Rust toolchain being available in the build-time environment (https://github.com/pyca/cryptography/issues/5771)
199
RUN dnf -y install rust cargo
2010
RUN dnf -y upgrade
2111

22-
2312
RUN chmod 777 /home/user/snowflake-connector-python
2413
ENV PATH="${PATH}:/opt/python/cp313-cp313/bin/"
2514
ENV PYTHONPATH="${PYTHONPATH}:/home/user/snowflake-connector-python/ci/docker/connector_test_lambda/"

0 commit comments

Comments
 (0)