Skip to content

Conversation

@alamashir
Copy link
Contributor


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

Fixed a bug where boolean fields set to False in Google provider
connection extras were incorrectly returning default values instead.

The issue occurred in two places:
1. get_field() function used 'or None' which treated False as falsy
2. _get_field() method used compound boolean logic that returned
   the default value when the actual value was False

This particularly affected BigQueryHook where use_legacy_sql=False
in connection extras would incorrectly return True.

Changes:
- Modified get_field() to only treat empty strings as None
- Modified _get_field() to explicitly check 'is not None'
- Added tests for False/falsy value handling

Fixes apache#47053
Update mock paths from 'airflow.hooks.base.BaseHook' to
'airflow.providers.common.compat.sdk.BaseHook' to match
the new import structure in Airflow 3.x.
Use sentinel pattern to distinguish unset parameters from explicitly False
values, allowing both connection extras and parameter overrides to work correctly.
@alamashir alamashir closed this Nov 17, 2025
@alamashir
Copy link
Contributor Author

opened by mistake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant