IBM Db2 provider: skip None-valued extra parameters to avoid KEY=None in connection strings - #72025
Open
ShubhamKapoor992 wants to merge 1 commit into
Open
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
|
ColtenOuO
reviewed
Aug 24, 2026
ColtenOuO
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the fix -- skipping None-valued extras in get_conn()/get_uri() looks correct and avoids emitting KEY=None to the Db2 driver.
I think there have a few things before this is ready to merge:
- The PR title should clearly describe the specific changes rather than just mentioning which provider were modified.
- I think we need to add a test to prevent the same issue from happening again in the future.
- To keep the branch clean, we should rebase onto main instead of merging.
- Similar to the PR title, commit messages should explain the reasoning and the solution behind the changes in detail, so that future contributors touching similar files can quickly understand the context.
… in connection strings
When a user leaves an optional extra field blank in the Airflow connection
form, the JSON stored in the extra field contains null values (e.g.
{"SSLServerCertificate": null}). Previously these were emitted verbatim
into both the ibm_db connection string (KEY=None;) and the SQLAlchemy URI
query string (?KEY=None), causing the Db2 driver to receive the literal
string "None" as a parameter value. This either triggers a connection
error or silently passes a bad value to the driver.
Fix: skip any extra key whose value is None before building the connection
string in get_conn() and before building the query string in get_uri().
Add parametrized tests covering both methods to prevent regression.
ShubhamKapoor992
force-pushed
the
db2-provider-test-connection
branch
from
August 24, 2026 14:26
183dc44 to
dc9895f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Skip
None-valued extra parameters when building Db2 connection strings and URIsWhen extra connection parameters contain keys with
Nonevalues (e.g. from a partially-filled connection form), the previous code would emit them as the literal string"None"in the Db2 connection string (KEY=None;) and in the SQLAlchemy URI query string (?KEY=None). Both cases result in either a connection error or silently passing a bad value to the driver.This fix skips
None-valued keys in bothget_conn()(connection string builder) andget_uri()(SQLAlchemy URI builder), so only explicitly configured parameters reach the Db2 driver.Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.Note: The change is small and self-contained and the provider isn't released nor used so I have not created the Git Issue.