Skip to content

Migrate Exasol provider to pyexasol 2.x#69695

Open
joshuabvarghese wants to merge 3 commits into
apache:mainfrom
joshuabvarghese:migrate-exasol-pyexasol2
Open

Migrate Exasol provider to pyexasol 2.x#69695
joshuabvarghese wants to merge 3 commits into
apache:mainfrom
joshuabvarghese:migrate-exasol-pyexasol2

Conversation

@joshuabvarghese

@joshuabvarghese joshuabvarghese commented Jul 10, 2026

Copy link
Copy Markdown

This PR upgrades the Exasol provider to support pyexasol version 2.x.

As pyexasol 2.x introduces changes to the underlying library API, this PR includes the necessary refactoring of the Exasol hook, updates to the unit tests, and adjustments to the provider's dependencies and documentation to maintain full compatibility.

Key Changes:

  • Variable Separation: Decoupled the Airflow Connection from ExaConnection in get_conn to resolve variable reuse typing errors.
  • Runtime Validation: Added explicit type checks for query_params (enforcing a literal dict to match pyexasol's **query_params unpacking) and sql statements (rejecting lists in get_records/get_first). This respects the DbApiHook base class interface while failing fast on invalid inputs.
  • Dependency Ceiling: Bumped pyproject.toml to pyexasol>=2.0.0,<3, establishing a proper major-version ceiling.
  • Test Coverage: Added negative testing to verify the new runtime validations and fixed a mocked test that was previously hiding a runtime TypeError.
  • Documentation: Updated README.rst, docs/index.rst, and docs/changelog.rst to reflect the breaking changes and new dependencies.

Testing

  • mypy strictness verified locally (0 errors in exasol.py).
  • Unit tests passing.
  • Standalone runtime harness executed against installed pyexasol 2.2.2 to verify end-to-end type execution on conn.execute().

@joshuabvarghese
joshuabvarghese marked this pull request as ready for review July 10, 2026 07:28
@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label Jul 15, 2026
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

uv.lock on main just moved via #69854 ("Bump datamodel-code-generator pin from 0.33.0 to 0.41.0"), commit 15a4478 and this PR currently conflicts.

Quickest fix:

git fetch upstream main && git rebase upstream/main
rm uv.lock && uv lock
git add uv.lock && git rebase --continue
git push --force-with-lease

Automated nudge — ignore if you're not ready to rebase. This comment is updated in place on future uv.lock bumps.

@joshuabvarghese
joshuabvarghese force-pushed the migrate-exasol-pyexasol2 branch from bd428aa to 612378a Compare July 16, 2026 10:44
Comment on lines +30 to +48
Breaking changes
~~~~~~~~~~~~~~~~

* ``Migrate exasol provider to pyexasol 2.x; remove the <2 cap (#69123)``

This provider now requires ``pyexasol>=2.0.0,<3``. pyexasol 2.0.0 ships a ``py.typed`` marker
(`pyexasol changelog <https://exasol.github.io/pyexasol/master/changes/changes_2.html>`__), which
surfaces several previously-hidden type mismatches in the Exasol hook:

* ``ExasolHook.get_records()`` and ``ExasolHook.get_first()`` now only accept a single SQL string,
not a list of statements (pyexasol's underlying ``execute()`` never actually supported a list; use
``ExasolHook.run()`` for executing multiple statements in sequence).
* ``parameters``/``query_params`` passed to ``get_records()``, ``get_first()``, ``run()``, and
``get_df()``/``get_pandas_df()`` must be a ``dict``/``Mapping``. Positional-style parameters
(lists/tuples) were never actually supported by pyexasol at runtime and will now raise a clear
``TypeError`` instead of failing deep inside pyexasol (or silently doing the wrong thing).
* If you pass ``export_params={"with_column_names": ...}`` to ``ExasolHook.export_to_file()`` or
``ExasolToS3Operator``, note that pyexasol 2.0.0 fixed this option to be interpreted as a real
boolean; previously any value (including ``False``) was treated as ``True``.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The list note stuff but nothing here strike as airflow breaking change is it?
Can you just remove the breaking changes title?

also, did you validate these statements? This feels AI generated. Please provide evidences that the points here are valid. Just referencing to the upstream docs/code should be enough

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.

Migrate exasol provider to pyexasol 2.x and remove the <2 cap

3 participants