Add IBM Db2 provider with Hook - #67532
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
|
Note, that some fomality with announcement/DISCUSS is neede to add a new provider, following https://github.com/apache/airflow/blob/main/providers/ACCEPTING_PROVIDERS.rst |
Thanks for pointing this out. I’ve created a DISCUSS thread on the dev@airflow.apache.org mailing list for the new IBM Db2 provider, following the ACCEPTING_PROVIDERS.rst process. |
|
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 |
5d470ba to
7b1633e
Compare
f523539 to
0844797
Compare
|
@jscheffl Thanks for your review, very helpful. I am working on the review comments. |
|
Was there a mailing list thread about this new provider? |
|
Thank you David. |
|
Provider is looking good now, thanks for the work and changes. I think you should start a vote now for this provider on the Apache Airflow devlist if the provider was already proposed there, if not you should start a proposal first before starting a vote. https://lists.apache.org/list.html?dev@airflow.apache.org Once the provider has been approved, then we can merge. |
Hi David, |
Check the link here to register to the devlist: https://airflow.apache.org/community/ Also check the static checks errors and resolve conflicts. |
4a62428 to
90dd18e
Compare
90dd18e to
b7b9f46
Compare
e7d5230 to
3b2f01e
Compare
4858804 to
f994f76
Compare
dabla
left a comment
There was a problem hiding this comment.
PR #67532 Review — New IBM Db2 Provider
🔴 Major
1. Db2Dialect.get_column_names() — positional predicate argument causes TypeError
providers/ibm/db2/src/airflow/providers/ibm/db2/dialects/db2.py:29–34
The author's intent is correct: always exclude autoincrement/identity columns by hardcoding the predicate. However, the base Dialect.get_target_fields() passes the predicate as a positional third argument:
self.get_column_names(
table,
schema,
lambda column: not column.get("identity", False) and not column.get("autoincrement", False),
)The override signature is (self, table, schema, **kwargs). Since **kwargs only captures keyword arguments, the positional lambda has no matching parameter and raises TypeError at runtime. The fix is to accept predicate by name and ignore it:
def get_column_names(self, table: str, schema: str | None = None, predicate=None, **kwargs) -> list[str] | None:
return super().get_column_names(
table, schema,
predicate=lambda col: not col.get("autoincrement", False),
)2. SQL placeholder style mismatch
providers/ibm/db2/README.rst:74–91 vs hooks/db2.py:54
The hook declares qmark style (?), but the README examples use %s / %(dept)s (pyformat). Those examples won't run as-is.
3. Connection doc contradicts hook implementation
providers/ibm/db2/docs/connections/db2.rst:31–60
The doc pushes database/protocol/security into extras, but the hook reads them from named connection fields (hooks/db2.py:68–73, 87–109). This will lead to silent misconfiguration.
🟡 Minor
4. System test uses wrong kwarg name
tests/system/ibm/db2/example_db2.py:55, 99, 137, 166
The hook is instantiated with conn_id=... but the correct kwarg is db2_conn_id. It works only because the default ID matches; a custom ID would be silently ignored.
5. SSL config naming inconsistency
providers/ibm/db2/README.rst:59–62 vs hooks/db2.py:35–41
README documents ssl/sslcert; the hook and provider metadata use
SECURITY/SSLServerCertificate. The user-facing contract is inconsistent.
✅ What looks good
- License headers present on all new files
- No
AirflowExceptionraised directly - No
time.time()used for duration logic - Commit messages follow Airflow conventions (no Conventional Commits prefixes)
- Provider scaffold is complete: hook, dialect,
provider.yaml,pyproject.toml,
connection doc, changelog, system example
Top priorities before merge: fix #1 (runtime crash on any upsert/insert with
target-field resolution) and #3 (misleads users into broken connections).
Drafted-by: Claude Sonnet 4.6 (no human review before posting)
Reviewed by @dabla
d612542 to
2da923b
Compare
…date datamodel-codegen version to 0.72.2 in generated files
…tion doc, system test conn kwarg, SSL naming
e335736 to
ea2db41
Compare
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
Description
This PR adds a new provider for IBM Db2 database support in Apache Airflow.
What: New Db2 provider package with Hook and Operator
Why: Enable Airflow users to connect to and execute queries against IBM Db2 databases
Changes
Db2Hook: ExtendsDbApiHookfor IBM Db2 connectivity with SSL supportAdded Db2Dialect: - Mentioned the SQLAlchemy dialect componentTesting
Important
🛠️ Maintainer triage note for @Amitkumar293 · by
@potiuk· 2026-07-28 16:22 UTCHelpful heads-up from the maintainers — please address before this PR can be reviewed:
The ball is in your court — you've been assigned to this PR. Fix the above, then mark it Ready for review.
See the Pull Request quality criteria for how to fix each item. There is no rush.
Automated triage — may be imperfect; a maintainer takes the next look. We use this two-stage triage process so maintainers' limited time goes to the conversation with you.