Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Pull Request Checks

on:
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
pip install --upgrade pip
pip install pytest build psycopg2-binary

- name: Build
run: |
python -m build

- name: Install build artifact (wheel)
run: |
pip install $(ls dist/*.whl)
- name: Run tests
run: |
pytest tests/test_import_from_sqlalchemy.py

- name: Install build artifact (tgz)
run: |
pip uninstall -y sqlalchemy-redshift
pip install $(ls dist/*.tar.gz)
- name: Run tests
run: |
pytest tests/test_import_from_sqlalchemy.py
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import re
from collections import defaultdict, namedtuple
from logging import getLogger

from importlib.resources import files
import sqlalchemy as sa
from packaging.version import Version
Expand Down Expand Up @@ -1212,7 +1211,7 @@ def create_connect_args(self, *args, **kwargs):
"""
default_args = {
'sslmode': 'verify-full',
'sslrootcert': str(files(__name__).joinpath('redshift-ca-bundle.crt')),
'sslrootcert': str(files("sqlalchemy_redshift").joinpath("redshift-ca-bundle.crt"))
}
cargs, cparams = (
super(Psycopg2RedshiftDialectMixin, self).create_connect_args(
Expand Down
11 changes: 11 additions & 0 deletions tests/test_import_from_sqlalchemy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from sqlalchemy import create_engine


def test_sqla_create_engine():
"""
Historically SQLalchemy's integration with this package has differed in behavior between Python versions.
This test should be run with each Python version that GX supports.
"""
create_engine(
"redshift+psycopg2://username:password@my-redshift-cluster.abcdef123456.us-west-2.redshift.amazonaws.com:5439/mydatabase"
)