Skip to content

[MAINTENANCE] Use the upstream sqlalchemy-redshift dialect instead of the GX fork - #12044

Open
joshua-stauffer wants to merge 1 commit into
developfrom
m/redshift-upstream-dialect
Open

[MAINTENANCE] Use the upstream sqlalchemy-redshift dialect instead of the GX fork#12044
joshua-stauffer wants to merge 1 commit into
developfrom
m/redshift-upstream-dialect

Conversation

@joshua-stauffer

Copy link
Copy Markdown
Collaborator

Summary

sqlalchemy-redshift 1.0.0 (released 2026-04-28) migrated to SQLAlchemy 2 and Python 3.10+ — the reason the GX fork was created in the first place. This drops gx-sqlalchemy-redshift in favor of upstream.

The fork is 15 commits ahead / 40 behind upstream main, and its substantive changes are the SQLAlchemy 2 requirement, pypi repackaging, and pkg_resources removal. Upstream 1.0.0 rewrote dialect.py far more thoroughly, so its migration supersedes the fork's. Last fork push was 2026-02-03.

No library code changes are required. Upstream publishes the same sqlalchemy_redshift import namespace and exports every symbol great_expectations/compatibility/aws.py imports.

A latent bug this also fixes

setup.py listed redshift in sqla1x_only_keys, so the extra carried sqlalchemy<2.0.0:

BEFORE redshift:    ['psycopg2-binary>=2.7.6', 'sqlalchemy-redshift>=0.8.8', 'sqlalchemy<2.0.0']
AFTER  redshift:    ['psycopg2-binary>=2.7.6', 'sqlalchemy-redshift>=1.0.0', 'sqlalchemy>=1.4.0']

That constraint pinned sqlalchemy-redshift back to 0.8.14 (April 2023) regardless of the declared floor, so pip install 'great_expectations[redshift]' has been silently installing a three-year-old dialect. Related fallout was already handled once in #11857.

Backward compatibility

pip install 'great_expectations[gx-redshift]' is a published, documented command, so the extra is kept as a deprecated alias that resolves identically to redshift. Verified:

+ sqlalchemy==2.0.51
+ sqlalchemy-redshift==1.0.0

Its requirements file duplicates requirements-dev-redshift.txt rather than using --requirement, because parse_requirements in setup.py doesn't resolve file references — it would emit the literal --requirement ... string as a requirement. test_deprecated_gx_redshift_extra_matches_redshift keeps the duplicate honest.

Worth flagging for reviewers: pip has no deprecation mechanism for extras, so there's no warning we can emit. The signal only reaches people reading docs, not people running a pinned install command. The eventual removal should get its own major-version callout rather than riding in quietly.

Changes

File Change
setup.py redshift moved from sqla1x_only_keys to sqla_keys; gx-redshift marked as a deprecated alias
reqs/requirements-dev-redshift.txt floor raised to >=1.0.0
reqs/requirements-dev-gx-redshift.txt now the upstream dialect, documented as a deprecated alias
reqs/requirements-dev-sqlalchemy.txt points at the canonical -redshift file
.github/workflows/ci.yml redshift matrix uses the redshift marker (was gx-redshift, with redshift commented out)
.github/workflows/data_source_cleanup.yml invoke deps -m redshift
tests/test_packaging.py retargeted at the canonical file; added the alias sync guard
docs/.../_sql.md, _sql_dialect_installation_commands.md one Redshift row; the stale "GX fork with SQLAlchemy 2.0" admonition replaced with the deprecation note

tasks.py needed no functional change — a redshift entry already existed in MARKER_DEPENDENCY_MAP pointing at the right file, and both marker names resolve to the pytest marker redshift.

Verification

Run locally:

  • tests/test_packaging.py + tests/test_markers.py — 4 passed.
  • Installed [redshift] from this branch into a clean env: resolves sqlalchemy 2.0.51 / sqlalchemy-redshift 1.0.0, gx-sqlalchemy-redshift absent. All 12 symbols in compatibility/aws.py import; redshift+psycopg2:// resolves to sqlalchemy_redshift.dialect.RedshiftDialect_psycopg2.
  • [gx-redshift] dry-run resolves identically.
  • The new sync assertion was mutation-tested — it fails when either file's dep set or version specifier drifts. (The pre-existing union-equality assertions in test_requirements_files do not catch drift in these files, since a change lands on both sides of the equality; that's why the alias needed its own guard.)
  • ruff check / ruff format --check clean; both workflow YAMLs parse.

Not verifiable locally: the actual Redshift integration tests need credentials and only run in the redshift CI job, which requires a non-draft PR. Leaving this as draft until that job is green — that's the real gate on this change, since it's the only thing that exercises the upstream dialect against a live cluster.

Out of scope

The fork's repo and its gx-sqlalchemy-redshift PyPI package remain published as-is; retiring those is separate from this change.

sqlalchemy-redshift 1.0.0 migrated to SQLAlchemy 2 and Python 3.10+, which
is what the GX fork existed to provide. Upstream's migration supersedes the
fork's, so the fork no longer earns its maintenance cost.

Point the `redshift` extra at sqlalchemy-redshift>=1.0.0 and move it out of
the SQLAlchemy 1.x-only group. That grouping was also a live bug: the extra
carried a `sqlalchemy<2.0.0` constraint, which forced resolution back to
0.8.14 (released 2023) no matter what floor the requirements file declared.

`gx-redshift` becomes a deprecated alias so existing install commands keep
working. Its requirements file duplicates the canonical one rather than
referencing it, because the requirements parser that builds the extras does
not resolve `--requirement` file references; a test keeps the two in sync.

No library changes are needed. Upstream exports every symbol the Redshift
compatibility module imports, under the same `sqlalchemy_redshift` namespace.
@netlify

netlify Bot commented Aug 7, 2026

Copy link
Copy Markdown

Deploy Preview for niobium-lead-7998 ready!

Name Link
🔨 Latest commit 61d509b
🔍 Latest deploy log https://app.netlify.com/projects/niobium-lead-7998/deploys/6a75e35ed64e54000870ddbd
😎 Deploy Preview https://deploy-preview-12044.docs.greatexpectations.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@joshua-stauffer
joshua-stauffer marked this pull request as ready for review August 7, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant