krnhotwings opened a new issue #15016:
URL: https://github.com/apache/airflow/issues/15016
**Apache Airflow version**: 2.0.1
**What happened**:
`OdbcHook` returns `None` for non-boolean-like string values in
`connect_kwargs` dict arg
**What you expected to happen**:
`connect_kwarg` values should remain as is.
**How to reproduce it**:
```python
>>> from airflow.providers.odbc.hooks.odbc import OdbcHook
>>> OdbcHook('my_conn', connect_kwargs={'CurrentSchema':
'SCHEMA'}).connect_kwargs
{'CurrentSchema': None}
```
**Anything else we need to know**:
The issue lies in:
https://github.com/apache/airflow/blob/db9febdb3be97832679d2ced8028fd7f1c21cd4e/airflow/providers/odbc/hooks/odbc.py#L170-L173
There's no `else` block that returns `val`. As it is, any string value will
instead return `None`.
Pardon my ignorance on the subject, but this raises a question: Why is
`clean_bool` being called in the first place for a user-provided dictionary?
I'm not sure how this is necessary because the user can provide a literal
boolean value in the dictionary if needed, no? If in the event that a driver
needs to take a case-sensitive boolean string for some parameter, then
`clean_bool` would make it impossible to provide such a value.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]