ciancolo opened a new pull request #17125:
URL: https://github.com/apache/airflow/pull/17125
Hello all,
During the RC tests, I founded this bug (generated from my PR #16365). The
bug is present when the user set in `Extra` parameter field in a `Tableau
Connection` the parameter `Verify` equals to `false` or `true`. During the JSON
parsing, the value is automatically read as `bool`, so the explicit conversion
`str` to `bool` is not necessary.
```
[2021-07-21, 07:15:33 UTC] {taskinstance.py:1455} ERROR - Task failed with
exception
Traceback (most recent call last):
File "/opt/airflow/airflow/models/taskinstance.py", line 1182, in
_run_raw_task
self._prepare_and_execute_task_with_callbacks(context, task)
File "/opt/airflow/airflow/models/taskinstance.py", line 1285, in
_prepare_and_execute_task_with_callbacks
result = self._execute_task(context, task_copy)
File "/opt/airflow/airflow/models/taskinstance.py", line 1315, in
_execute_task
result = task_copy.execute(context=context)
File
"/opt/airflow/airflow/providers/tableau/operators/tableau_refresh_workbook.py",
line 70, in execute
with TableauHook(self.site_id, self.tableau_conn_id) as tableau_hook:
File "/opt/airflow/airflow/providers/tableau/hooks/tableau.py", line 70,
in __init__
verify = bool(strtobool(verify))
File "/usr/local/lib/python3.8/distutils/util.py", line 313, in strtobool
val = val.lower()
AttributeError: 'bool' object has no attribute 'lower'
```
**Code changes:**
1. Added check type before conversion for `Verify` parameter
2. Added test in TableauHook tests to check this situation
Thank you
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]