Skip to content

Commit a02a3a5

Browse files
sfc-gh-turbaszeksfc-gh-mkubiksfc-gh-fpawlowskisfc-gh-pczajkasfc-gh-jszczerbinski
authored
Add support for async io (#2608)
Co-authored-by: Mikołaj Kubik <[email protected]> Co-authored-by: Filip Pawłowski <[email protected]> Co-authored-by: Patryk Czajka <[email protected]> Co-authored-by: Jakub Szczerbiński <[email protected]> Co-authored-by: Maxim Mishchenko <[email protected]> Co-authored-by: github-actions <[email protected]> Co-authored-by: Naresh Kumar <[email protected]> Co-authored-by: Piotr Bulawa <[email protected]> Co-authored-by: Zexin Yao <[email protected]> Co-authored-by: Rob Clevenger <[email protected]> Co-authored-by: Mark Keller <[email protected]> Co-authored-by: Michał Hofman <[email protected]> Co-authored-by: Yijun Xie <[email protected]> Co-authored-by: Patryk Cyrek <[email protected]> Co-authored-by: Xiaohu Zhao <[email protected]> Co-authored-by: Peter Mansour <[email protected]> Co-authored-by: Susheel Aroskar <[email protected]> Co-authored-by: Myles Borins <[email protected]> Co-authored-by: Sid Shetkar <[email protected]> Co-authored-by: Yuyang Wang <[email protected]> Co-authored-by: Sanchit Karve <[email protected]> Co-authored-by: Adam Kolodziejczyk <[email protected]> Co-authored-by: Julian <[email protected]> Co-authored-by: Gleb Khmyznikov <[email protected]> Co-authored-by: George Merticariu <[email protected]> Co-authored-by: Brandon Chinn <[email protected]> Co-authored-by: jochenott <[email protected]> Co-authored-by: Jochen Ott <[email protected]> Co-authored-by: Sean Noonan <[email protected]> Co-authored-by: HeroCC <[email protected]> Co-authored-by: Naren Krishna <[email protected]> Co-authored-by: Edward Qin <[email protected]> Co-authored-by: Jakub Wilkowski <[email protected]> Co-authored-by: Mathias Florin <[email protected]> Co-authored-by: David Szmolka <[email protected]> Co-authored-by: Eric Woroshow <[email protected]> Co-authored-by: Bing Li <[email protected]> Co-authored-by: Jamison <[email protected]> Co-authored-by: Adam Ling <[email protected]> Co-authored-by: Pablo Nicolás Estevez <[email protected]> Co-authored-by: Richard Ebeling <[email protected]> Co-authored-by: Filip Ochnik <[email protected]> Co-authored-by: Zihan Li <[email protected]> Co-authored-by: Thomas Kissinger <[email protected]> Co-authored-by: Leonhard Spiegelberg <[email protected]> Co-authored-by: Berkay Öztürk <[email protected]> Co-authored-by: Harsh Pathak <[email protected]> Co-authored-by: Eric Buehl <[email protected]> Co-authored-by: James Kasten <[email protected]> Co-authored-by: Dawid Heyman <[email protected]> Co-authored-by: Nikita Peshkov <[email protected]>
1 parent abfe207 commit a02a3a5

File tree

176 files changed

+40870
-66
lines changed

Some content is hidden

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

176 files changed

+40870
-66
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

.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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ 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.
1012
- v4.1.1(TBD)
1113
- Relaxed pandas dependency requirements for Python below 3.12.
1214
- Changed CRL cache cleanup background task to daemon to avoid blocking main thread.

0 commit comments

Comments
 (0)