Skip to content

Commit e206dfb

Browse files
Merge branch 'main' into NO-SNOW-wiremock-tests-cleanup
2 parents b4b4e54 + 3427a80 commit e206dfb

File tree

203 files changed

+42306
-202
lines changed

Some content is hidden

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

203 files changed

+42306
-202
lines changed

.github/workflows/build_test.yml

Lines changed: 109 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,114 @@ jobs:
446446
path: |
447447
junit.py${{ env.shortver }}-lambda-ci-dev.xml
448448
449+
test-aio:
450+
name: Test asyncio ${{ matrix.os.download_name }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
451+
needs: build
452+
runs-on: ${{ matrix.os.image_name }}
453+
strategy:
454+
fail-fast: false
455+
matrix:
456+
os:
457+
- image_name: ubuntu-latest
458+
download_name: manylinux_x86_64
459+
- image_name: macos-latest
460+
download_name: macosx_x86_64
461+
- image_name: windows-latest
462+
download_name: win_amd64
463+
python-version: ["3.10", "3.11", "3.12"]
464+
cloud-provider: [aws, azure, gcp]
465+
steps:
466+
- uses: actions/checkout@v4
467+
- name: Set up Python
468+
uses: actions/setup-python@v4
469+
with:
470+
python-version: ${{ matrix.python-version }}
471+
- name: Display Python version
472+
run: python -c "import sys; print(sys.version)"
473+
- name: Set up Java
474+
uses: actions/setup-java@v4 # for wiremock
475+
with:
476+
java-version: 11
477+
distribution: 'temurin'
478+
java-package: 'jre'
479+
- name: Fetch Wiremock
480+
shell: bash
481+
run: curl https://repo1.maven.org/maven2/org/wiremock/wiremock-standalone/3.11.0/wiremock-standalone-3.11.0.jar --output .wiremock/wiremock-standalone.jar
482+
- name: Setup parameters file
483+
shell: bash
484+
env:
485+
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
486+
run: |
487+
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" \
488+
.github/workflows/parameters/public/parameters_${{ matrix.cloud-provider }}.py.gpg > test/parameters.py
489+
- name: Setup private key file
490+
shell: bash
491+
env:
492+
PARAMETERS_SECRET: ${{ secrets.PARAMETERS_SECRET }}
493+
run: |
494+
gpg --quiet --batch --yes --decrypt --passphrase="$PARAMETERS_SECRET" \
495+
.github/workflows/parameters/public/rsa_keys/rsa_key_python_${{ matrix.cloud-provider }}.p8.gpg > test/rsa_key_python_${{ matrix.cloud-provider }}.p8
496+
- name: Download wheel(s)
497+
uses: actions/download-artifact@v4
498+
with:
499+
name: ${{ matrix.os.download_name }}_py${{ matrix.python-version }}
500+
path: dist
501+
- name: Show wheels downloaded
502+
run: ls -lh dist
503+
shell: bash
504+
- name: Upgrade setuptools, pip and wheel
505+
run: python -m pip install -U setuptools pip wheel
506+
- name: Install tox
507+
run: python -m pip install tox>=4
508+
- name: Run tests
509+
run: python -m tox run -e aio
510+
env:
511+
PYTHON_VERSION: ${{ matrix.python-version }}
512+
cloud_provider: ${{ matrix.cloud-provider }}
513+
PYTEST_ADDOPTS: --color=yes --tb=short
514+
TOX_PARALLEL_NO_SPINNER: 1
515+
- name: Combine coverages
516+
run: python -m tox run -e coverage --skip-missing-interpreters false
517+
shell: bash
518+
- uses: actions/upload-artifact@v4
519+
if: always()
520+
with:
521+
include-hidden-files: true
522+
name: coverage_aio_${{ matrix.os.download_name }}-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
523+
path: |
524+
.tox/.coverage
525+
.tox/coverage.xml
526+
527+
test-unsupporeted-aio:
528+
name: Test unsupported asyncio ${{ matrix.os.download_name }}-${{ matrix.python-version }}
529+
runs-on: ${{ matrix.os.image_name }}
530+
strategy:
531+
fail-fast: false
532+
matrix:
533+
os:
534+
- image_name: ubuntu-latest
535+
download_name: manylinux_x86_64
536+
python-version: [ "3.9", ]
537+
steps:
538+
- uses: actions/checkout@v4
539+
- name: Set up Python
540+
uses: actions/setup-python@v4
541+
with:
542+
python-version: ${{ matrix.python-version }}
543+
- name: Display Python version
544+
run: python -c "import sys; print(sys.version)"
545+
- name: Upgrade setuptools, pip and wheel
546+
run: python -m pip install -U setuptools pip wheel
547+
- name: Install tox
548+
run: python -m pip install tox>=4
549+
- name: Run tests
550+
run: python -m tox run -e aio-unsupported-python
551+
env:
552+
PYTHON_VERSION: ${{ matrix.python-version }}
553+
PYTEST_ADDOPTS: --color=yes --tb=short
554+
TOX_PARALLEL_NO_SPINNER: 1
555+
shell: bash
556+
449557
test-rockylinux9:
450558
name: Test Rocky Linux 9 rockylinux9-${{ matrix.python-version }}-${{ matrix.cloud-provider }}
451559
needs: lint
@@ -499,7 +607,7 @@ jobs:
499607
combine-coverage:
500608
if: always()
501609
name: Combine coverage
502-
needs: [lint, test, test-fips, test-lambda]
610+
needs: [lint, test, test-fips, test-lambda, test-aio]
503611
runs-on: ubuntu-latest
504612
steps:
505613
- uses: actions/checkout@v4

.github/workflows/check_installation.yml

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ concurrency:
1616
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1717

1818
jobs:
19-
test-installation:
20-
name: Test Boto Dependency
19+
test-installation-boto:
20+
name: Test boto dependency
2121
runs-on: ubuntu-latest
2222
steps:
2323
- uses: actions/checkout@v4
@@ -54,3 +54,44 @@ jobs:
5454
# Deactivate and clean up
5555
deactivate
5656
rm -rf test_no_boto_env
57+
58+
test-installation-aioboto:
59+
name: Test aioboto dependency
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- name: Set up Python
65+
uses: actions/setup-python@v4
66+
with:
67+
python-version: 3.12
68+
69+
- name: Test installation with [aio] (should include aioboto)
70+
shell: bash
71+
run: |
72+
python -m venv test_no_boto_env
73+
source test_no_boto_env/bin/activate
74+
75+
python -m pip install '.[aio]'
76+
77+
# Check that aioboto3 and aiobotocore are installed
78+
pip freeze | grep aioboto || exit 1 # aioboto3 and aiobotocore should be installed
79+
80+
# Deactivate and clean up
81+
deactivate
82+
rm -rf test_no_boto_env
83+
84+
- name: Test [aio] installation with SNOWFLAKE_NO_BOTO=1 (should exclude aioboto)
85+
shell: bash
86+
run: |
87+
python -m venv test_no_boto_env
88+
source test_no_boto_env/bin/activate
89+
90+
SNOWFLAKE_NO_BOTO=1 python -m pip install .
91+
92+
# Check that boto3, botocore, aioboto, aiobotocore are NOT installed
93+
pip freeze | grep boto && exit 1
94+
95+
# Deactivate and clean up
96+
deactivate
97+
rm -rf test_no_boto_env

.github/workflows/jira_close.yml

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,37 @@ jobs:
88
close-issue:
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Checkout
12-
uses: actions/checkout@v3
13-
with:
14-
repository: snowflakedb/gh-actions
15-
ref: jira_v1
16-
token: ${{ secrets.SNOWFLAKE_GITHUB_TOKEN }} # stored in GitHub secrets
17-
path: .
18-
- name: Jira login
19-
uses: atlassian/gajira-login@master
20-
env:
21-
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
22-
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
23-
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
2411
- name: Extract issue from title
2512
id: extract
2613
env:
2714
TITLE: "${{ github.event.issue.title }}"
2815
run: |
2916
jira=$(echo -n $TITLE | awk '{print $1}' | sed -e 's/://')
3017
echo ::set-output name=jira::$jira
31-
- name: Close issue
32-
uses: ./jira/gajira-close
18+
19+
- name: Close Jira Issue
3320
if: startsWith(steps.extract.outputs.jira, 'SNOW-')
34-
with:
35-
issue: "${{ steps.extract.outputs.jira }}"
21+
env:
22+
ISSUE_KEY: ${{ steps.extract.outputs.jira }}
23+
run: |
24+
JIRA_API_URL="${{ secrets.JIRA_BASE_URL }}/rest/api/2/issue/${ISSUE_KEY}/transitions"
25+
26+
curl -X POST \
27+
--url "$JIRA_API_URL" \
28+
--user "${{ secrets.JIRA_USER_EMAIL }}:${{ secrets.JIRA_API_TOKEN }}" \
29+
--header "Content-Type: application/json" \
30+
--data "{
31+
\"update\": {
32+
\"comment\": [
33+
{ \"add\": { \"body\": \"Closed on GitHub\" } }
34+
]
35+
},
36+
\"fields\": {
37+
\"customfield_12860\": { \"id\": \"11506\" },
38+
\"customfield_10800\": { \"id\": \"-1\" },
39+
\"customfield_12500\": { \"id\": \"11302\" },
40+
\"customfield_12400\": { \"id\": \"-1\" },
41+
\"resolution\": { \"name\": \"Done\" }
42+
},
43+
\"transition\": { \"id\": \"71\" }
44+
}"

.github/workflows/jira_issue.yml

Lines changed: 64 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,76 @@ jobs:
1313
issues: write
1414
if: ((github.event_name == 'issue_comment' && github.event.comment.body == 'recreate jira' && github.event.comment.user.login == 'sfc-gh-mkeller') || (github.event_name == 'issues' && github.event.pull_request.user.login != 'whitesource-for-github-com[bot]'))
1515
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v3
18-
with:
19-
repository: snowflakedb/gh-actions
20-
ref: jira_v1
21-
token: ${{ secrets.SNOWFLAKE_GITHUB_TOKEN }} # stored in GitHub secrets
22-
path: .
23-
24-
- name: Login
25-
uses: atlassian/[email protected]
16+
- name: Create JIRA Ticket
17+
id: create
2618
env:
2719
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
2820
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
2921
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
22+
run: |
23+
# debug
24+
set -x
25+
TMP_BODY=$(mktemp)
26+
trap "rm -f $TMP_BODY" EXIT
3027
31-
- name: Create JIRA Ticket
32-
id: create
33-
uses: atlassian/[email protected]
34-
with:
35-
project: SNOW
36-
issuetype: Bug
37-
summary: '${{ github.event.issue.title }}'
38-
description: |
39-
${{ github.event.issue.body }} \\ \\ _Created from GitHub Action_ for ${{ github.event.issue.html_url }}
40-
fields: '{"customfield_11401":{"id":"14723"},"assignee":{"id":"712020:e527ae71-55cc-4e02-9217-1ca4ca8028a2"},"components":[{"id":"16413"}], "labels": ["oss"], "priority": {"id": "10001"} }'
28+
# Escape special characters in title and body
29+
TITLE=$(echo '${{ github.event.issue.title }}' | sed 's/"/\\"/g' | sed "s/'/\\\'/g")
30+
31+
echo "${{ github.event.issue.body }}" > $TMP_BODY
32+
echo -e "\n\n_Created from GitHub Action_ for ${{ github.event.issue.html_url }}" >> $TMP_BODY
33+
BODY=$(cat "$TMP_BODY" | sed 's/"/\\"/g' | sed "s/'/\\\'/g")
34+
35+
PAYLOAD=$(jq -n \
36+
--arg issuetitle "$TITLE" \
37+
--arg issuebody "$BODY" \
38+
'{
39+
fields: {
40+
project: { key: "SNOW" },
41+
issuetype: { name: "Bug" },
42+
summary: $issuetitle,
43+
description: $issuebody,
44+
customfield_11401: { id: "14723" },
45+
assignee: { id: "712020:e527ae71-55cc-4e02-9217-1ca4ca8028a2" },
46+
components: [{ id: "16413" }],
47+
labels: ["oss"],
48+
priority: { id: "10001" }
49+
}
50+
}')
51+
52+
# Create JIRA issue using REST API
53+
RESPONSE=$(curl -s -X POST \
54+
-H "Content-Type: application/json" \
55+
-H "Accept: application/json" \
56+
-u "$JIRA_USER_EMAIL:$JIRA_API_TOKEN" \
57+
"$JIRA_BASE_URL/rest/api/2/issue" \
58+
-d "$PAYLOAD")
59+
60+
# Extract JIRA issue key from response
61+
JIRA_KEY=$(echo "$RESPONSE" | jq -r '.key')
62+
63+
if [ "$JIRA_KEY" = "null" ] || [ -z "$JIRA_KEY" ]; then
64+
echo "Failed to create JIRA issue"
65+
echo "Response: $RESPONSE"
66+
echo "Request payload: $PAYLOAD"
67+
exit 1
68+
fi
69+
70+
echo "Created JIRA issue: $JIRA_KEY"
71+
echo "jira_key=$JIRA_KEY" >> $GITHUB_OUTPUT
4172
4273
- name: Update GitHub Issue
43-
uses: ./jira/gajira-issue-update
4474
env:
4575
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46-
with:
47-
issue_number: "{{ event.issue.id }}"
48-
owner: "{{ event.repository.owner.login }}"
49-
name: "{{ event.repository.name }}"
50-
jira: "${{ steps.create.outputs.issue }}"
76+
REPOSITORY: ${{ github.repository }}
77+
ISSUE_NUMBER: ${{ github.event.issue.number }}
78+
JIRA_KEY: ${{ steps.create.outputs.jira_key }}
79+
ISSUE_TITLE: ${{ github.event.issue.title }}
80+
run: |
81+
# Update Github issue title with jira id
82+
GH_UPD_RESPONSE=$(curl -s \
83+
-X PATCH \
84+
-H "Authorization: Bearer $GITHUB_TOKEN" \
85+
-H "Accept: application/vnd.github+json" \
86+
-H "X-GitHub-Api-Version: 2022-11-28" \
87+
"https://api.github.com/repos/$REPOSITORY/issues/$ISSUE_NUMBER" \
88+
-d "{\"title\":\"$JIRA_KEY: $ISSUE_TITLE\"}")

.github/workflows/port_changes_to_sp.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ repos:
6161
exclude: |
6262
(?x)^(
6363
src/snowflake/connector/session_manager\.py|
64+
src/snowflake/connector/aio/_session_manager\.py|
6465
src/snowflake/connector/vendored/.*
6566
)$
6667
args: [--show-fixes]

DESCRIPTION.md

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

99
# Release Notes
10+
- v4.2.0(TBD)
11+
- Added support for async I/O. Asynchronous version of connector is available via `snowflake.connector.aio` module.
12+
- v4.1.1(TBD)
13+
- Relaxed pandas dependency requirements for Python below 3.12.
14+
- Changed CRL cache cleanup background task to daemon to avoid blocking main thread.
15+
- Fixed NO_PROXY issues with PUT operations
16+
1017
- v4.1.0(November 18,2025)
1118
- Added the `SNOWFLAKE_AUTH_FORCE_SERVER` environment variable to force the use of the local-listening server when using the `externalbrowser` auth method.
1219
- This allows headless environments (like Docker or Airflow) running locally to auth via a browser URL.

ci/anaconda/recipe/meta.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ requirements:
3535
- setuptools >=40.6.0
3636
- wheel
3737
- cython
38+
# The way nano arrow builds relies on no-use-pep517, but that flag is fully dropped starting pip 25.3
39+
- pip <25.3
3840
- python {{ python }}
3941
run:
4042
{% if py == 39 %}

0 commit comments

Comments
 (0)