Migrate Exasol provider to pyexasol 2.x#69695
Conversation
|
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-leaseAutomated nudge — ignore if you're not ready to rebase. This comment is updated in place on future |
7167ae9 to
bd428aa
Compare
bd428aa to
612378a
Compare
| 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``. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
There are two things I can confirm with the changelog
-
with_column_namesboolean fix: I can confirm that pyexasol's changelog has a dedicated bugfix (https://github.com/exasol/pyexasol/releases#release-2.2.1 - # 265)). So any value used to get forced to beTrue. Now it should require a real Boolean -
py.typedmarker: Confirmed. In the Same Changelog batch above (# 298) pyexasol added it when swapping the deprecatedrsadependency forcryptography. I think that this is the actual mechanism not a breaking change.
However,
-
get_records()/get_first()only accepting a single SQL string. I cannot confirm this one tho. No changelog says explicitly this changed in 2.x. However, it's consistent with every example in pyexasol's docs since they only show a single string. This means that's always the case. -
Parameters should be
dict/Mapping: Can't confirm either, but no changelog ref to point to.
So, two claims are true, two are unverified assumptions.
I suggest to drop the "Breaking changes" title since it is not a change to the provider's own interface and drop the two unverifiable bullets entirely. Keep only the two we can back:
This provider now requires ``pyexasol>=2.0.0,<3``. pyexasol 2.0.0 added a
``py.typed`` marker and fixed ``export_params={"with_column_names": ...}``
to require a real boolean (previously any value, including ``False``, was
treated as ``True`` — pyexasol changelog, bugfix #265).
This PR upgrades the Exasol provider to support
pyexasolversion 2.x.As
pyexasol2.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:
ConnectionfromExaConnectioninget_connto resolve variable reuse typing errors.query_params(enforcing a literaldictto matchpyexasol's**query_paramsunpacking) andsqlstatements (rejecting lists inget_records/get_first). This respects theDbApiHookbase class interface while failing fast on invalid inputs.pyproject.tomltopyexasol>=2.0.0,<3, establishing a proper major-version ceiling.TypeError.README.rst,docs/index.rst, anddocs/changelog.rstto reflect the breaking changes and new dependencies.Testing
mypystrictness verified locally (0 errors inexasol.py).pyexasol 2.2.2to verify end-to-end type execution onconn.execute().