diff --git a/airbyte_cdk/sources/declarative/interpolation/interpolated_boolean.py b/airbyte_cdk/sources/declarative/interpolation/interpolated_boolean.py index 04cc7e6941..32ce1f3158 100644 --- a/airbyte_cdk/sources/declarative/interpolation/interpolated_boolean.py +++ b/airbyte_cdk/sources/declarative/interpolation/interpolated_boolean.py @@ -19,6 +19,7 @@ "0.0", {}, False, + None, [], (), set(), diff --git a/unit_tests/sources/declarative/interpolation/test_interpolated_boolean.py b/unit_tests/sources/declarative/interpolation/test_interpolated_boolean.py index 3cdb749333..e857e8a6ba 100644 --- a/unit_tests/sources/declarative/interpolation/test_interpolated_boolean.py +++ b/unit_tests/sources/declarative/interpolation/test_interpolated_boolean.py @@ -14,6 +14,7 @@ "non_empty_array": [1], "empty_dict": {}, "empty_tuple": (), + "none_value": None, } @@ -32,6 +33,24 @@ ("test_empty_array_is_false", "{{ config['empty_array'] }}", False), ("test_empty_dict_is_false", "{{ config['empty_dict'] }}", False), ("test_empty_tuple_is_false", "{{ config['empty_tuple'] }}", False), + ("test_none_literal_is_false", "{{ none }}", False), + ("test_get_missing_key_is_false", "{{ config.get('missing_key') }}", False), + ("test_explicit_null_value_is_false", "{{ config['none_value'] }}", False), + ( + "test_and_chain_short_circuits_to_none_is_false", + "{{ config['string_key'] and config.get('missing_key') }}", + False, + ), + ( + "test_or_chain_short_circuits_to_none_is_false", + "{{ config.get('missing_key') or config['none_value'] }}", + False, + ), + ( + "test_or_chain_with_truthy_value_is_true", + "{{ config.get('missing_key') or config['string_key'] }}", + True, + ), ("test_lowercase_false", '{{ "false" }}', False), ("test_False", "{{ False }}", False), ("test_True", "{{ True }}", True),